Page 1 of 1

Avoid resampling colors in imagecopyresized() and imagecopyr

Posted: Thu Oct 18, 2012 4:11 am
by clunizzi
Hi coders!
i'm working around GD function for images. I'm using imagecopyresized() and imagecopyresampled() and i see that the colors of returned image are completly changed. For example, original RGB color was "3c3f70" at position (1,1) and become "656d61" in the output file at the same (i,j) position. I used imagecreatetruecolor() like php.net suggest, but doesn't work.
The original file is just a matrix of colors that i resize in a smaller one which must have the same colors. Is possible to avoid the colors changing in the output file?

Thanks in advantage, hope to solve this issue.

Andrea.

Re: Avoid resampling colors in imagecopyresized() and imagec

Posted: Thu Oct 18, 2012 12:28 pm
by requinix
Changing from a blue to a gray is unusual - GD often will change colors but only a very small amount (and perhaps only with palette images).
What's your code?