On Thu, Sep 11, 2008 at 02:55:20PM -0400, we recorded a bogon-computron 
collision of the <[EMAIL PROTECTED]> flavor, containing:
> This question is admittedly off topic, but I figure this group is more
> likely to tolerate a techhie question.
> 
> I have a program that collects screen shots on a PC at work.  I need to
> analyze these GIF images to look for a specific color at ONE pixel location
> which indicates a problem.  It would be nice if I could run some program
> from a batch file that would analyze these GIF images by the hundred.
> 
> Is there any program anyone knows of that would report the color of a given
> pixel as text output?  I could pipe the output of a batch to a text file and
> then parse it for the color I'm looking for.  For example, if the pixel
> color at X,Y is black, I'm fine, if it's cyan, I need to look at that image.

Yes, there is a set I know of ... but:

> Unfortunately, I'm confined to windows on the PC we use.

Bleah.

Well, my knee-jerk reaction is that you should get the netpbm tools running
under cygwin on that machine.  You can do what you want with netpbm.

giftopnm will convert GIF images on standard in to "Portable aNy Map" format 
on standard out.

pamcut will take the image on standard in and clip it to a rectangle you
specify with "-left" "-right" "-top" and "-bottom" parameters, sending it
on to standard out.

If you use pamcut to create a 1x1 image of the one pixel location you're 
interested, you can convert that image to some simple format, ppm, which
should be easy to check for the one color you're looking for.

For example, I tried this:

jpegtopnm < guaje10.jpg | pamcut -top 100 -bottom 100 -left 11 -right 11| 
pnmtopnm - plain

and got:
P3
1 1
255
63 58 80

where "P3" is the magic number of a "plain" (i.e. ascii) portable pixmap, 
"1 1" is the extent of the image, and "63 58 80" is the RGB tuple of the
pixel there.  255 is the maximum color value.

If I'd specified more than one column, there'd be that many tuples on a line.
One line per row of the resulting image.

I did this with a jpeg image, so I used jpegtopnm, but with a gif image you
just do giftopnm instead.

Does that help?

Your need to use Losedows for this complicates matters, because you'll have
to get Cygwin and install netpbm in it.  netpbm is almost certainly one of
the packages you can simply install through Cygwin Setup.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
 "Argue for your limitations and sure enough, they're yours."  -- R. Bach



_______________________________________________
Xastir mailing list
[email protected]
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir

Reply via email to