Skia png image moire pattern on gradient

hey there!

Sorrily, it seems that transparency combined with a linear color space is a tricky topic. Not only in vvvv.

I am unsure why this problem didn’t surface with the old SkiaRenderer implementation, but now the SkiaRenderer is working on all graphics hardware. So that’s a big plus and we very likely will stick with that new implementation surfacing this new behavior.

I attached a modified version of your patch. It shows that if you go for gamma color space the problems vanish. For 2d applications, this is probably the way to go: skia test gamma color space.zip (39.0 KB)
If you want to have 3d app with high-quality lighting then linear color space is best. That’s also the reason why we use linear color space as the default.

We are still searching for elegant ways to combine the best of the two worlds. And we are not the only ones struggling with this topic as can be witnesses here: https://forum.unity.com/threads/urp-raw-image-transparency-problem-linear-vs-gamma-color-space.865603/
Anyway, if switching your whole app to gamma color space is an option for you then this is the easiest way out.

When working with linear color space you can see that this problem surfaces regardless of whether you use file textures (stride-only approach) or via SkiaRenderer. So our guess is that we need to find a solution that covers all those scenarios and it’s not so much a bug of the SkiaRenderer. But again: we are aware of the general issue and still trying to find a solution that may cover all the cases where transparency and linear color space get combined.

Hope that helps, sorry for the trouble.
Edit: note that this patch uses a node SetColorSpace that only is available in the newest gamma preview.

1 Like