How to get a good quality thumbnail

后端 未结 5 444
-上瘾入骨i
-上瘾入骨i 2020-12-09 10:15

I am trying to create a high quality thumbnail of this image, with Java and Scalr 3.2

\"full

5条回答
  •  一向
    一向 (楼主)
    2020-12-09 10:38

    Note that if your images have an alpha channel, both libraries are problematic. I'm only talking about shrinking images, I haven't tested enlarging them.

    java-image-scaling may create an ugly border around the transparent edges depending on the image, and this looks very bad. I found no way to avoid this.

    Scalr is only problematic using the (ultra) quality modes. It can easily be used in a way that works fine, though: bicubic interpolation leaves artifacts in transparent images, so you may want to avoid it. Since it's the default for (ultra) quality images, and scaleImageIncrementally() is protected you'd have to subclass it for this, though, if you want the quality (a fraction higher than 2 looks very blurry with bilinear filtering, though).

提交回复
热议问题