program that gives number of black pixels in a .tif file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
mut
Newbie
Posts: 1
Joined: Wed May 24, 2006 5:57 pm

program that gives number of black pixels in a .tif file

Post by mut » Wed May 24, 2006 6:09 pm

I have a question, please:

I have > 2000 tif-files that contain only black and white pixels (1bit). I need a program or a script that tells me (automatically) the number of black pixels in each file. I do not want to open each file seperately to analyse the number of black pixels.

Does anybody knows a simpel solution for my problem?

Thanks, mut.

GregS
Newbie
Posts: 7
Joined: Tue Jun 06, 2006 10:47 pm

Perl Script to find number of black pixels

Post by GregS » Wed Jun 07, 2006 11:34 pm

Hello,

Here is a Perl script with very slight modification will give you what you want. Remember, if the page is skewed with a black boarder, it will also be counted.

http://search.cpan.org/src/GREGOR/Image ... ty/TIFF.pm

Cheers,

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts