Thread

Posted on Sun Apr 27 06:39:29 2008 by anguila
when I use setpixel(x,y, color!=black) it puts those pixel black
$p = Imager->new(xsize=>70, ysize=>32, channels=> 4); $p->setpixel(x=>32, y=>50, color=>'#DC6464'); $p->write(file=>'p.gif', type=>'gif') or die $p->errstr();

I put the sample code to know the image information in my code and the report:
Image information: Width: 70 Height: 32 Channels: 4 Bits/Channel: 8 Virtual: No Actual number of colors in image: 2 Type: direct Modifiable Channels: 0 1 2 3 4

The image have all the pixels black and it have 4 channels.. so isn't in grayscale, and I put the color '#DC6464'. I don't know what I'm missing... Thanks :)
Direct Responses: 7773 | Write a response
Posted on Mon Apr 28 02:57:45 2008 by tonyc in response to 7772
Re: when I use setpixel(x,y, color!=black) it puts those pixel black

Your image is 32 pixels high and you're trying to write at y == 50.

Changing:

$p->setpixel(x=>32, y=>50, color=>'#DC6464');

to

$p->setpixel(x=>32, y=>31, color=>'#DC6464');

will draw a pixel on the last row of the image.

Write a response