You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bitmaps larger than 2^14 (16384) in width (and possibly height) are not interpolating when drawn at a smaller size. I noticed this with Gray8 bitmaps and Alpha8 image shaders, but I assume it happens with larger pixel formats too.
Here is a fiddle where it is working in skia: https://fiddle.skia.org/c/374657f33d440c8f81390d9f50a9374a
I ran the test on my computer with the latest Skia code and it worked as well. I tried to build SkiaSharp's fork of Skia but failed, so I wasn't able to test it there.
here is some SkiaSharp code which reproduces it:
var surfaceWidth = 500;
var surfaceHeight = 300;
var surface = SKSurface.Create(surfaceWidth, surfaceHeight, SKColorType.Bgra8888, SKAlphaType.Premul);
var canvas = surface.Canvas;
canvas.Clear(new SKColor(255, 255, 255));
var bitmapWidth = 16384;
var bitmapHeight = 10;
var pixels = Marshal.AllocHGlobal(new IntPtr(bitmapWidth * bitmapHeight));
unsafe
{
var bytes = (byte*) pixels;
for(long y = 0; y < bitmapHeight; y++)
for (long x = 0; x < bitmapWidth; x++)
{
var index = y * bitmapWidth + x;
if (x / 3 == y)
bytes[index] = 0;
else
bytes[index] = 255;
}
}
var info = new SKImageInfo(bitmapWidth, bitmapHeight, SKColorType.Gray8, SKAlphaType.Premul);
var image = SKImage.FromPixels(info, pixels);
var scale = .66f;
canvas.Scale(scale, scale);
var paint = new SKPaint();
paint.FilterQuality = SKFilterQuality.High;
canvas.DrawImage(image, SKRect.Create(bitmapWidth, bitmapHeight), paint);
using (var stream = new FileStream("renderout.png", FileMode.OpenOrCreate, FileAccess.Write))
using (var outimage = surface.Snapshot())
using (var data = outimage.Encode(SKEncodedImageFormat.Png, 100))
data.SaveTo(stream);
changing the image width to 16383 interpolates as expected:
Hi @jackkutilek. We have added the status/try-latest-version label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Bitmaps larger than 2^14 (16384) in width (and possibly height) are not interpolating when drawn at a smaller size. I noticed this with Gray8 bitmaps and Alpha8 image shaders, but I assume it happens with larger pixel formats too.
Here is a fiddle where it is working in skia: https://fiddle.skia.org/c/374657f33d440c8f81390d9f50a9374a
I ran the test on my computer with the latest Skia code and it worked as well. I tried to build SkiaSharp's fork of Skia but failed, so I wasn't able to test it there.
here is some SkiaSharp code which reproduces it:
changing the image width to 16383 interpolates as expected:
The text was updated successfully, but these errors were encountered: