Clear questions and runnable code
get the best and fastest answer
Re: About GD Image Data Output Methodsby BrowserUk (Pope)
|on Jun 07, 2015 at 12:11 UTC||Need Help??|
->gd is libgd's own internal format. It is unlikely to be recognised by any other graphics libraries or image converters.
It is a very simple format that consists of a 11 byte header (for truecolor) and the X-width * 4 * Y-height bytes of uncompressed image data.
A simple 10x10 (truecolor) image with a diagonal line of colored pixels constructed like this:
And then output as ->gd and unpacked as bytes :
looks like this (manully formatted):
It should not be hard to knock up Perl script that converts that to one of the ASCII image formats prevalent on *nix, and then convert that to png.
Note:Palleted images have two extra bytes in the header (not sure about the purpose); a 256 * 4-byte color table following the trailer block; and then width * 1-byte * height image data, where each byte value is an index into the color table.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked