Add ability to select alpha type on save
Before 2.66, Blender left alpha handling to the user. The design notes called that out as the problem:
File formats usually have well defined alpha mode, premul or key, but we do not respect this. It's basically up to the user now to guess what the right mode is.
Solution: image file I/O should take care of any needed conversion.
So the selector was removed by design: the format now defines the alpha mode
That shipped in 2.66 as:
For file saving, the image will be automatically converted to a suitable alpha type for the file format.
8 bit formats (such as PNG) will be saved with straight alpha, float formats (such as OpenEXR, DPX) will use premultiplied alpha. TIFF … 8 bit TIFF will be save with straight alpha, but 16 bit TIFF will be saved with premultiplied alpha.
And explicitly about removing Straight from render output:
The reason for this is that we can now automatically save files with the right alpha mode, rather than the user having set it manually.
But in some cases, for example for sprites for game engine, you want to have premultiplied alpha and file format like png. Alpha type will be defined in game engine, so we use png only as a data container. In this case we can make the switcher that most of users will left by default, and if you realy want to, you can set to something different:
3 Comments
Youp, While format specs as png clearly says its non premultiplied. Even LLMs know that its(was) commonly violated, and even Blender allows users to decide on imported png's. Its weird that Blender used to allow that, and now ppl have to jump hoops around that limitation.
Your proposal to have default option of spec compliant and additional option for custom alpha sounds like nice solution.
Anyways, its shocking to me that PNG 3.0 didn't fixed that limitation of lack of official support for straight alpha.
PNG isn't the only option. For instance, the TIFF format behaves strangely in my view: 8-bit files are saved with straight alpha, while 16-bit ones use premultiplied alpha. TIFF supports both, so having the ability to choose would be a nice feature.
TIFF supports both alpha variants, but its mess metadata and is kinda old format
PNG on the other hand had opportunity LAST YEAR to fix that and they didnt.
anyways: here is interesting comments on CD videos from one of png and tiff creators: