Bug 375873 - single layer images should save the layer, not the projection to preserve the alpha channel
Summary: single layer images should save the layer, not the projection to preserve the...
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 3.1.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 375879 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-01 23:33 UTC by Bronson
Modified: 2019-04-24 08:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bronson 2017-02-01 23:33:38 UTC
PNG supports keeping the color channels bellow the alpha. But there is no way from krita to enable this.

For example.
Create put an image into krita. Set an alpha channel/mask to full black. Export the image as png.
Then open the image, and disable the alpha channel. The image comes out a single black (by default) color. 
What I expect is that the image should still be there.

This is for use in game materials and shaders where you need access to all RGBA channels for blending etc...


Example plugin for photoshop thats open source:
http://www.fnordware.com/superpng/
Comment 1 Halla Rempt 2017-02-02 09:39:34 UTC
That is probably because png and tga and so on don't save your layer; it saves the composed image. And at the composition phase, a pixel with alpha 0 gets all its color channels set to 0, if I remember correctly.
Comment 2 Halla Rempt 2017-02-27 19:08:13 UTC
*** Bug 375879 has been marked as a duplicate of this bug. ***
Comment 3 Halla Rempt 2017-02-27 19:09:54 UTC
Either as in the updated subject, or we should change all composite ops to not discard color data if the pixel is transparent. That, however, will likely cause a lot of performance loss and a lot of unforeseen issues.
Comment 4 Dmitry Kazakov 2019-04-24 07:32:31 UTC
Hi, Bronson!

Exactly for the purpose of keeping alpha channel intact, we have a Split Alpha functionality:

1) Select the layer you would like to export
2) Right Click -> Split Alpha
3) Select new transparency mask, right click, Save Merged

The resulting image will contain alpha data, and color data intact. 

I think we should add documentation about it
Comment 5 Dmitry Kazakov 2019-04-24 08:47:41 UTC
Okay, when saving the image with only one layer without any masks, the color data is saved correctly. I'm not sure if flattening the image every time is a good workflow though, so it is better to use the Split Alpha for that.

Here is a draft for the Krita Manual:
https://phabricator.kde.org/D20782

I will downgrade the bug to 'wish' category now. Perhaps one day we will invent some nicer workflow for this.