Colors on stacked png look wrong

Here’s a semi-transparent green circle (R=0.0, G=1.0, B=0.0, A=0.3) made in Krita with the default color space (sRGB-elle-V2-srgbtrc.icc):

and here’s how various programs (incl. Krita) composite this png on top of blue and white backgrounds:

The premultiplied version is only here to show that this is not an alpha premultiplication issue, since this output looks different to all the others.

For Gimp

I opened the png and was prompted to chose between keeping the color profile and converting it. However, there was no noticeable difference between either of those choices, so the issue is not here.

For Blender:

For Imagemagick:

I used the command:
convert bg.png -compose atop circle.png -composite output.png

In conclusion:

There are 2 groups here: Gimp & Blender vs Krita & Imagemagick.

It seems to me that Blender and Gimp give a better result than the other group. But why? What parameter am I missing?

Use another colorspace than RGB, it should be OK :slight_smile:

There’s already a topic about that but can’t found it now…
I need to search

Grum999

Yes there was a topic about that but it seems it was deleted?

I think the issue is that the blending is made between gamma corrected colors. But that is kind of standard, I think photoshop does it like that as well. I guess that’s because it is faster, but I’m not sure.

Probably that :cry:
@raghukamath ??

I clearly remember I provided a solution for that using if I remember another colorspace (Lab* layer from memory, currently on my phone and not able to check testing files saved on my computer…)
If it has been deleted, really frustrating to spent time and see another explanation/solution being deleted…

Grum999

Of course! How could I forget this great minutephysics video explaining just that?

And here’s Krita’s documentation on that:

However, changing color space to a linear one like scRGB or sRGB-elle-v2-g10.icc doesn’t just affect blended colors. It also changes colors on a single layer, without applying any blurring or other operation. Every single pixel changes, which messes everything up in my work.

I think rather than having to change color space, there should be an option like the checkbox shown in the minutephysics video (dunno what software this is):

which would square values before blending colors and squareroot them back after. Gimp and Blender apparently do it by default.

Here’s Gimp vs Krita in the same color space:
comparison

Currently on my smartphone, not able to provide detailled explanation for now, but the idea is to change colorspace of one layer only, not colorspace of document

Grum999

Thanks for replying even from your phone. Don’t worry though, I’m in no rush.

I searched a bit about using a different color space on a single layer and didn’t find anything yet.
I tried exporting the top layer in a linear space and importing it back as a linked file layer but it doesn’t make a difference.

It’s Layer → Convert → Convert Layer Colour Space, in case you missed that.

I do not remember deleting anything. May be the user themselves did it? I will try to search it.

Just tried. It only works for blending within the layer
blur
not between 2 layers:
between-layers

1 Like

I think it was this topic: https://krita-artists.org/t/gamma-corrected-color-blending/47893

I found the link by searching “gamma site:https://krita-artists.org/” on google.

1 Like

@Deif_Lou thanks yes! It might be this one…

Unfortunately topic is not available anymore
Might be a user asking to delete everything once solution has been provided :cry:

Maybe page is on cache Somewhere, will try to check once at will be at home

Grum999

@Deif_Lou and @Grum999 thanks for the link. Looking at the logs it was me who deleted that user and their post. I believe this is because they requested it. Right now I am not in front my computer to check mails. I’ll check and confirm. Also I can see the post butsome images have been cleaned up. I can ressurect it but I think that will be violation of the user’s wish. I wish they had chosen to anonymise the post and keep them.

I have some part of topics by email :sweat_smile:
And part of topic are available in google cache but it’s not complete…

I found my video example:
@ChameleonScales I think it’s what you said by “It only works for blending within the layer / not between 2 layers”

And… yes, it only works within the layer itself, not between 2 layers.
But there’s a workaround.
It’s tricky, but it works:

I’m not sure why, but colorspace for a group can’t be converted (you can try, but it does nothing)
So just create a group in a Lab document, copy/paste group in an RGB document, and then it works: composition of RGB layer use Lab colorspace :sweat_smile:

Grum999

1 Like

Thanks, that’s an interesting trick! I think we should report this as a bug because it doesn’t seem normal that we have to jump documents.
This also made me notice that changing to Lab (16 or 8bit) doesn’t screw up all the colors in my layers like changing to a linear RGB does.
Always work in Lab I guess.

1 Like

Weird thing for me is that the dockers are like 8bit RGB if I am not mistaken and mixing colour is clear.

Lab is one of the best.

Yeah that is probably because the whole document is different colour space so the composite is made in the document’s colour space. The layer colour space is local to that layer

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.