Created attachment 123304 [details] capture SUMMARY STEPS TO REPRODUCE 1. load any image, preferably the one has some high-saturated colors. 2. Apply Color to Alpha to it, over white background layer. OBSERVED RESULT Color changes. EXPECTED RESULT The original color is preserved. Color to Alpha in GIMP does not do this. The color stays exactly the same regardless of its threshold. (Thought It's necessary to change the layer mode to 'legacy' after 2.10 update...) SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
did you adjust the trheshold too high?? If you only want to remove pure white you have to adjust threshold to something around 30, any value higher than that will probably make color to alpha remove other colors near white, like yellows. I do loose some color information if threshold is high. Tested on 8bit RGB ColorSpace.
(In reply to vanyossi from comment #1) > did you adjust the trheshold too high?? > > If you only want to remove pure white you have to adjust threshold to > something around 30, any value higher than that will probably make color to > alpha remove other colors near white, like yellows. > > I do loose some color information if threshold is high. > > Tested on 8bit RGB ColorSpace. The point is that 'the color shouldn't change as I move the silder'. Sorry for mentioning other applications but in gimp it only scrapes opacity and not the color.
Thanks for your comment! Automatically switching the status of this bug to REPORTED so that the KDE team knows that the bug is ready to get confirmed. In the future you may also do this yourself when providing needed information.
Created attachment 123448 [details] Alpha to color effect Logic tells me you are right, it should only affect the alpha channel, but In reality as we make a color more transprent it looses saturation to the white below. I don't know how is implemented in gimp 2.10 but it gives me the same results. Attached image is from gimp Color to alpha. the first two panels I applied Color to alpha, then converted the alpha from the channel directly into a transparency mask: The first one has the mask turned off, the second one has mask on (in the first on e you see black on fully transparent colors) There is loss in color. The third and last panel: after applying color to alpha I made a selection from that alpha information and applied it as an transparency mask to the original image. The third is with the transparency mask on, and the last one with the transparency mask off (Here we only affect the alpha but we also see loss of color). Doing the exact same in Krita will yield the same results. Color to Alpha -> Split Alpha -> Alpha into Mask. For the second: Color to Alpha -> Ctrl + Click on layer thumbnail (or Select -> Select Opaque) -> right click on layer: Add Transparency Mask. However in Krita the preview does seem to shift color. This seems to happen as the Threshold is less agressive and affects much more softly other colors which in turn gives the apperance of a shift in color (less saturated). In Gimp this effect can also be seen but to a lesser extent since the threshold is much more contrasted, in fact its in Krita it is not possible to adjust the threshold to affect the colors in the same way as the gimp.
(In reply to vanyossi from comment #4) > Created attachment 123448 [details] > Alpha to color effect > > Logic tells me you are right, it should only affect the alpha channel, but > In reality as we make a color more transprent it looses saturation to the > white below. I don't know how is implemented in gimp 2.10 but it gives me > the same results. > > Attached image is from gimp Color to alpha. the first two panels I applied > Color to alpha, then converted the alpha from the channel directly into a > transparency mask: The first one has the mask turned off, the second one has > mask on (in the first on e you see black on fully transparent colors) There > is loss in color. The third and last panel: after applying color to alpha I > made a selection from that alpha information and applied it as an > transparency mask to the original image. The third is with the transparency > mask on, and the last one with the transparency mask off (Here we only > affect the alpha but we also see loss of color). > > Doing the exact same in Krita will yield the same results. Color to Alpha -> > Split Alpha -> Alpha into Mask. For the second: Color to Alpha -> Ctrl + > Click on layer thumbnail (or Select -> Select Opaque) -> right click on > layer: Add Transparency Mask. > > However in Krita the preview does seem to shift color. This seems to happen > as the Threshold is less agressive and affects much more softly other colors > which in turn gives the apperance of a shift in color (less saturated). In > Gimp this effect can also be seen but to a lesser extent since the threshold > is much more contrasted, in fact its in Krita it is not possible to adjust > the threshold to affect the colors in the same way as the gimp. Can you provide me the original picture of this? In my gimp it only affects the opacity and gives me 0 loss of color. (Remember : You need to change mode of the target layer from 'Default' to 'Legacy' on the top right of the layer docker!)
This a link to the original xcf: https://drive.google.com/open?id=1YjfmfWuiI5AMiR7QuYGsZjKx_Wxr-q4u Im not familiar with the mode you mention in the gimp, but the gimp docs suggests it is a switch to activate legacy blending modes for the dropdown list. If that is the case that would explain why chaning the "mode" does nothing to the ouput of color to Alpha in gimp when I tried out.
https://imgur.com/yabotQ4 Hope this help to reproduce the process.
Created attachment 170471 [details] Red to Yellow gradient with Orange removed
Hi, I'm a long time user of Gimp, who just started trying out Krita 5.2.2. Krita's colour to alpha filter indeed works nothing like Gimp's, and no changing the threshold value can fix that: [Red to Yellow gradient, Orange removed](https://bugs.kde.org/attachment.cgi?id=170471) At a threshold of 43/255, Krita is both overly agressive on the red side of the gradient, andoverly lenient on the yellow side. The red side never reaches 100% opacity, while the yellow leaves a large strip that is 100% opaque. Both sides of the gradient still have traces of orange in them, when they should be pure Red or Yellow. > I don't know how is implemented in gimp 2.10 but it gives me the same results. As was mentionned, Gimp can be very finicky with its blending, so in order to get the expected result in Gimp you need to either: - With the Color to Alpha filter, switch the layer's composite space to "Perceptual", or switch the Blend mode to Legacy Normal. - Or, do not use the Color to Alpha filter, instead use the Bucket Fill tool with the non-legacy "Color Erase" blend mode. My expectation for this filter is that it should be the opposite operation to the "Behind" blend mode. Removing a colour and then backfilling with the same colour should result in a visually indistinguishable picture. (Safe for arithmetic imprecision.) I haven't checked the code for Gimp, but intuitively: if the Normal/Behind blend modes are linear interpolations between two colours, then Colour to Alpha/Colour Erase would be a form of linear *extrapolation*. Amongst the line of possible results, it would pick the first colour where any of the RGB channel has reached an extreme (either 0 or 255).
For fun I tried figuring out how Gimp's colour erase works, and this is what I came up with, and I amble to reproduce the exact same colour code as gimp with this: https://github.com/Estecka/colour-to-alpha/blob/master/ColourErase.cpp