Link to home
Start Free TrialLog in
Avatar of stakor
stakorFlag for United States of America

asked on

change a pixel

Is it possible to change a pixel in an image using perlmagick using a HTML color value (Hex value i.e. FFFF00)? So, for instance if you wanted to change test.jpg's first pixel to be a HTML color value how would one do that?
ASKER CERTIFIED SOLUTION
Avatar of arober11
arober11
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stakor

ASKER

Is there a way to have the input just be a straight html RGB value? (ie. FFFF00) Instead of the comma separated base 10?
Yes:  


$rgb  = '#ffff00';
$image->Set('pixel[1,1]'=>$rgb);

Open in new window



Note:
See also: http://www.imagemagick.org/script/color.php

The two 256 values should be 255 in my earlier example.