planetOzh, PHP GD : imagecolorallocate() Limitation,

Did you know it ? PHP GD's imagecolorallocate() can only allocate 255 colors in a palette based image created by imagecreate() (no such limitation when you use function imagecreatetruecolors() by the way).

This sounds pretty stupid as well as rather undocumented, but anyway, here is a new version of my GD Gradient Fill PHP class, which now produces correct colors for images larger than 256 pixels (hence containing gradients with more than 256 colors)

No Comment yet

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free accountSpam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?

I love WordPress plugins so I wrote a book!

This site

This is planetOzh, weblog of Ozh, a 35 years old dude living in France with an interest for, errr, like, computer things. I have a wife, 2 kids, and one computer-unrelated job. Give my eye a gentle click to read more about me.