A problem with colour spaces when using VideoSource

The two images clearly show that the colour spaces and the conversion to the colour space are different.

Why did this catch my attention? When using Avalonia SKImageControl, I even get double dimming if I process an image obtained via Stride.

Can you help me sort this out? Because colour spaces and their processing are always a headache, and now there’s a bug on top of that.

and here’s what I get when using Avalonia:

I remember there were some changes to the colour spaces of the textures. Perhaps this is related to the latest updates?

7.3-0007

Indeed, there have been changes in that area just recently. Can you please compare against 7.2?

@Elias That’s an interesting idea! I gave it a go. It looks so similar that I can’t tell them apart.

Ok, had another look at this, and yes, the output via the route VideoIn/VideoPlayer → Skia was no longer correct in latest previews. Upcoming build should fix this. Not sure yet though if that will also fix the issue you have in particular by piping everything to Avalonia.

1 Like

Hm, quickly patched your last screenshot and new build is a) darker then in 7.2, b) avalonia rendering is super slow. What did change now is that the Video node returns a texture using the R16FG16F… format - maybe Avalonia can’t deal with that? Will need to check the Avalonia code I guess…

@Elias Your theory is also supported by the fact that if I submit an image that I explicitly render in 8-bit (using texture rendering), this problem does not occur (I’m not sure)

It would be great if @antokhio could join in and have a look from his end.

Not sure what can I add here? I don’t think I’m doing any type of conversion, that’s presumable where rendering happens:

It’s just passthrough of whatever you pass in there.

I would suggest try via SkiaLayerControl, and DrawImage

Just checked skia draw image, and there is nothing related to color space at all:

I suspect it’s expected to pass image in same format as canvas in there…

I wonder why, in that case, the image becomes darker when it’s displayed in SkiaImageControl? What’s more, this doesn’t happen in version 7.2!

Well there is a

So likely when it creates rendering, it’s one color space, when you stream something from camera it maybe another color space…

Ok, after some digging in VL.Avalonia I think I found both issues. Will need to wrap up a PR now.

1 Like

PR is up

2 Likes

Release is up

1 Like