Guidance needed in all things image manipulation,

I have a jpg image of a microarray slide. In other words, roughly a 2x4.5K pixel image with rows of colored spots on it. Here's a link to an example, if you've never seen one; it's not quite what I am working with, but the idea is the same.

What I need to do is, given a set of coordinates (the spots are arranged into blocks and the blocks have rows and columns), get that one spot as a 16x16 pixel image.

Simple, right? Except that the slides are never quite aligned properly, and the width tends to differ by a few pixels. So in other words, the spot at 1,1 may be 5 pixels away from the left edge, and the last spot in the same column maybe 10 pixels farther away. They have one feature to help with this, in each corner there is a few spots (the number identifies which corner it is, but the corner spot is there for all four) of controls, meaning they always come up as bright green.

So, is there a module out there that will help me crop and rotate the image so that each of the four corner spots has two sides excactly at the edges of the image, and all the spots along each side are precisely aligned?

My graphics manipulation experience with perl is extremely limited, I use GD.pm quite a lot but only to create simple charts and such, I don't know where to begin here.

So this is really a two part question: first, what do I do to grab a specific region of a larger image? I can always just grab a somewhat larger are so I get the spot I am looking for in the middle and a bit offcenter. And two, what, if anything, can I use to do the above-described alignment. At this point I am more curious about how to do The Right Thing, if it's more trouble than it's worth I'll just do the more sloppy method described above.

Thanks,


In reply to image clean up and alignment by glwtta

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.