I'm slicing some images with SkiaSharp, some pictures don't cover the whole bitmap, and looks like there is random noise on some of the pictures.
The simplest was to reproduce is just create new empty bitmaps & save them in a loop. Something like this:
// imgSize = 224
// savePath is a new file path every time
var bm = new SKBitmap(imgSize, imgSize);
var subSaveStream = File.OpenWrite(savePath);
var subImage = SKImage.FromBitmap(bm).Encode(SKEncodedImageFormat.Png, 100);
subImage.SaveTo(subSaveStream);
First thing to note is the saved file sizes go from 305 byte to up to 50k! Some have barely visible artifacts, some have crazy noise patterns like this:
My question:
I guess I could just "erase it black" like this ex.Erase(SKColors.Black), and done. But is this expected?
Environment:
I can reproduce it on my machine (Win10 laptop) and a Debian server, so let's assume it's not my machine.
SkiaSharp 1.68 + .NET Core SDK 2.2.300
Plus SkiaSharp.NativeAssets.Linux 1.68 on Debian 9
