bzotto / rgba_bitmap

"RGBA" : Specification (and C routines) for the dumbest, most useful bitmap image file format!
19 stars 3 forks source link

Add important note about imagemagick #5

Closed rayanamal closed 6 months ago

bzotto commented 6 months ago

Thank you for the note and the updated text! Unfortunately, it might surprise you to learn that imagemagick's definition of an "rgba" file is some ancient thing from the 1990s and has nothing to do with this idea-- that is, except that the image data seems like it's actually the same. I will update the README here myself to make that note to prevent further confusion, but what would be cool would be someone (perhaps you?) contributing something to the imagemagick code that could also produce this kind of RGBA file.

rayanamal commented 6 months ago

Imagemagick’s output is true to your spec except the first ‘RGBA’ chars and the width and height bytes. Looked it up a bit but I wasn’t even able to locate the code that generated or described RGBA format in the imagemagick codebase. And I just wrote a Lua RGBA parser that depends on this behavior. So can’t, sorry.

bzotto commented 6 months ago

I'm going to chalk up that "coincidence" to something like "simple formats suggest themselves to multiple people". :)

FYI, here's the RGBA format code in imagemagick (July 1992!!) https://github.com/ImageMagick/ImageMagick/blob/main/coders/rgb.c

If you end up writing code that works with the RGBA style in this repo (with the header) and you'd like to include it here for other folks, feel free to let me know. Thanks again for the heads up.