This isn't a specific answer, but maybe it might give you some idea on which direction to go. Read the documentation for

Imager
Imager::ImageTypes
Imager::Draw

and then try this:
#!/usr/bin/perl -l use strict; use warnings; use Imager; use Imager::Fill; use Data::Dumper::Concise; my $file = 'Screenshot.png'; my $img = Imager->new(); $img->open( file => $file, type => 'png' ); print "Image information: \n"; print "Width: ", $img->getwidth(); print "Height: ", $img->getheight(); print "Channels: ", $img->getchannels(); print "Bits/Channel: ", $img->bits(); print "Virtual: ", $img->virtual() ? "Yes" : "No"; my $colorcount = $img->getcolorcount; print "Actual number of colors in image: "; print defined($colorcount) ? $colorcount : ">512"; print "Type: ", $img->type(); if ($img->type eq 'direct' ) { print "Modifiable Channels: "; print join " ", map { ($img->getmask() & 1<<$_) ? $_ : () } 0..$img->getchannels(); } my(@rgbanames) = qw( red green blue alpha ); my $mask = $img->getmask(); for (0..$img->getchannels() - 1) { print $rgbanames[$_] if $mask & 1<<$_; } my $color = $img->getpixel(x=>50, y=>70); print Dumper($color);

In reply to Re: Getting pixel color of screen by Khen1950fx
in thread Getting pixel color of screen by sebastiannielsen2

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.