Thanks, that explains a lot.
The different SkSamplingOptions yield different results, but all of them look blocky (at the hairs) compared with GIMP.
I scaled down the same image using LINEAR scaling in GIMP and Skia. GIMP looks much better.
I suspect this is due to the anti aliasing. The linear scaling algorithm should be the same logic in both, or not?
![gimp_vs_skia.png](https://groups.google.com/group/skia-discuss/attach/150f2f4c81d61/gimp_vs_skia.png?part=0.1&view=1)
This is the Kotlin code using skiko:
fun Image.scaleToThumbnail(): Image {
val surface = Surface.makeRasterN32Premul(480, 320)
surface.canvas.drawImageRect(
image = this,
src = Rect.makeWH(width.toFloat(), height.toFloat()),
dst = Rect.makeWH(480f, 320f),
samplingMode = SamplingMode.LINEAR,
paint = Paint().apply { isAntiAlias = true }, // no effect
strict = true
)
return surface.makeImageSnapshot()
}
I think I can't upload custom images on SKIA fiddle.