I have a fun/cool script in mind that involves images.
In order for it to work, I need to be able to look at various file formats (mostly jpg, gif, sometimes png, and the very occasional tiff).
I think I can handle that much relatively easily - images usally lead to either GD or ImageMagick - or some spinoff thereon.

What I specifically am curious about is analysis of the image. I want to look at an image and determine what % of the image is a specific color (well, actually what % is within a specific range of colors).
As I understand it (from a 10billion foot view) - I will need to open XYZ file, regardless of its type, and convert it to a bitmap (in memory) - the bitmap is then an array that has the color information for each pixel of that image. I can then just iterate that array and look at that color info and if it matches my desires, do whatever floats my boat (likely increment a counter).

So the end result I can open 10 files and see that file ABC has more of the color I want than file XYZ does, and I can sort them out that way.

Is that generally how one can think of images? Or am I missing massive steps?
If that is the general process - which modules allow me to look at a bitmap at that level?
A quick CPAN search would seem to indicate Image::Info::BMP - but glancing over that doesn't really leng much information.

Any suggestions from ye fine monks?

-------------------------------------------------------------------
There are some odd things afoot now, in the Villa Straylight.

In reply to Image analysis by AssFace

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.