Page 1 of 1

PHP GD - setpixel on jpeg smeared the colors

Posted: Thu Mar 10, 2011 2:35 am
by shlomi
hi,

i'm using the php-gd method setpixel() to set a single pixel on loaded jpg image (loaded from existing file).
the problem is that when i'm do it it's seems like the pixel smeared around the original pixel point and this method not just set the pixels itself.
maybe this occur due to i'm use the method couple of times on the same pixel with the same color so the gd not just replace the pixel but put couple of layers on it and then the result is the smeared area.
i'm a programmer and not understand the graphics depths but it's seems weird that setpixel that should set individual pixel actually effect on more than the pixels itself.
i tried to read about it via Google but seems that most of the examples are for PNG and not dealt with JPGs

do anyone know what i'm talking about and how to solve this issue?

thanks.

Shlomi.

Re: PHP GD - setpixel on jpeg smeared the colors

Posted: Thu Mar 10, 2011 9:48 am
by pickle
Are you setting the pixel, then saving it as a JPG? At lower qualities, JPG compression will blur single pixels.