yar
June 10, 2026, 7:28pm
1
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
Elias
June 11, 2026, 9:27am
3
Indeed, there have been changes in that area just recently. Can you please compare against 7.2?
yar
June 11, 2026, 11:10am
4
@Elias That’s an interesting idea! I gave it a go. It looks so similar that I can’t tell them apart.
Elias
June 11, 2026, 11:11am
5
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
Elias
June 11, 2026, 11:23am
6
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…
yar
June 11, 2026, 11:29am
7
@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:
var imageResolution = new Vector2(Image.Width, Image.Height);
AspectRatioUtils.FixAspectRatio(
ref boundsRectangle,
ref imageResolution,
Mode,
Anchor,
out RectangleF bounds
);
canvas.DrawImage(Image, bounds.ToRect().ToSKRect());
}
canvas.Restore();
}
}
public override void Dispose()
{
// no op;
}
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:
public void DrawPoint (float x, float y, SKColor color)
{
using (var paint = new SKPaint { Color = color, BlendMode = SKBlendMode.Src }) {
DrawPoint (x, y, paint);
}
}
// DrawImage
public void DrawImage (SKImage image, SKPoint p, SKPaint paint = null)
{
DrawImage (image, p.X, p.Y, paint);
}
public void DrawImage (SKImage image, float x, float y, SKPaint paint = null)
{
if (image == null)
throw new ArgumentNullException (nameof (image));
SkiaApi.sk_canvas_draw_image (Handle, image.Handle, x, y, paint == null ? IntPtr.Zero : paint.Handle);
}
I suspect it’s expected to pass image in same format as canvas in there…
yar
June 11, 2026, 2:27pm
10
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
using System;
using System.ComponentModel;
namespace SkiaSharp
{
public unsafe class SKColorSpace : SKObject, ISKNonVirtualReferenceCounted
{
private static readonly SKColorSpace srgb;
private static readonly SKColorSpace srgbLinear;
static SKColorSpace ()
{
srgb = new SKColorSpaceStatic (SkiaApi.sk_colorspace_new_srgb ());
srgbLinear = new SKColorSpaceStatic (SkiaApi.sk_colorspace_new_srgb_linear ());
}
internal static void EnsureStaticInstanceAreInitialized ()
{
// IMPORTANT: do not remove to ensure that the static instances
// are initialized before any access is made to them
This file has been truncated. show original
So likely when it creates rendering, it’s one color space, when you stream something from camera it maybe another color space…
Elias
June 11, 2026, 4:28pm
12
Ok, after some digging in VL.Avalonia I think I found both issues. Will need to wrap up a PR now.
1 Like