I have an image file, with a 128 byte header, followed by raw RGBA data and the width and height are stored at offset 72 and 74 as short ints (big endian). I have successfully been able to read the header, however, I need a way to save the raw RGBA as PNG format and/or GIF. How can I do that in PHP?
cheers
If you have the gd lib installed (check with phpinfo(); ) it’s something like
EDIT
You said it was RGBA data. Assuming standard 4 bytes per channel and that your raw data is an integer array, it should be: