in reply to Re^2: Loading PNG in Perl?
in thread Loading PNG in Perl?
That will print out the RGB value for every XY coordinate, row-first. There's a ton of other information you can extract. You just have to spend a few hours reading ALL the docs. It's well worth the effort.my $image = GD::Image->newFromPng($filename); my ($height, $width) = $image->getBounds; foreach my $x ( 0 .. $width ) { foreach my $y ( 0 .. $height ) { my ($index) = $image->getPixel($x,$y); my ($r,$g,$b) = $image->rgb($index); print "($x,$y) -> ($r,$g,$b)\n"; } }
|
|---|