GNOME Bugzilla – Bug 354034
Saving indexed images with an alpha channel as Raw only writes half the image.
Last modified: 2008-01-15 14:08:18 UTC
Please describe the problem: When saving indexed images with an alpha channel as Raw, only half the image is actually written. Steps to reproduce: 1. Create an indexed image with an alpha channel. 2. Save as 'Raw'. 3. Inspect saved file. Actual results: The Raw file will have a size of width*height, while it should be twice as big as for every pixel an alpha value is written as well. Expected results: The creation of a correct Raw file. Does this happen every time? Yes. Other information: A workaround is to double the vertical size of the image before saving as Raw.
The question is, how should a raw image with alpha channel look like? The current save code doesn't handle it correctly, but the raw loader also doesn't deal with alpha channel in the raw file. I suggest that the alpha channel of an indexed drawable is ignored.
I think the current approach is ok (<color index, alpha value> pairs). I would actually prefer to have indexed images with an alpha channel handled differently in GIMP altogether. I'd like to have an RGBA palette, rather than RGB palette + separate alpha for each pixel. But there's probably a good reason for how it's currently implemented. To get back on-topic, I hope that the alpha channel won't be ignored, because I need that information in the raw output. ;) How about saving it in a separate file? In any case, if people don't want the alpha data in the raw files they can just remove the alpha channel before saving.
Fixing the save part is trivial then, but the load routines in the plug-in would have to be changed as well to handle the output. This is going to be a little more complex, but not really difficult. Walter, since you seem to have a use for this plug-in, I suggest that you try to come up with a patch for it.
I switched to PNG for my application, which supports RGBA palettes (although I haven't been able to find an image editor that truly supports those). As neither of us seem to have any desire to properly fix the Raw plugin at this point, it seems best to have the plugin abort if an alpha channel is present in the image.
We have a strong desire to fix the plug-in, but we are short of developer resources. If you can't help, the bug report will be sitting here until someone finds the time to properly fix the issue.
2006-09-05 Sven Neumann <sven@gimp.org> * plug-ins/common/raw.c: fixed saving of INDEXEDA drawables. Added code to load such files. Fixes bug #354034.