Closed goooong closed 3 years ago
before: after:
File sizes increasing for the same size image is completely expected when using JPEG.
There can be a couple of reasons for this -- first, if the original JPEG is using a lower quality setting (i.e. lower compression quality) the resulting image can be a larger file size. Second reason, even if the original image and the resulting image both were using the same quality setting, saving a JPEG again as a JPEG can lead to lower compression ratios, hence larger file sizes. And the resulting image will be likely less visual quality than the original. These two effects are due to the nature of JPEG compression.
This is not an issue with Thumbnailator, but a general nature of using JPEG image compression.
File sizes increasing for the same size image is completely expected when using JPEG.
There can be a couple of reasons for this -- first, if the original JPEG is using a lower quality setting (i.e. lower compression quality) the resulting image can be a larger file size. Second reason, even if the original image and the resulting image both were using the same quality setting, saving a JPEG again as a JPEG can lead to lower compression ratios, hence larger file sizes. And the resulting image will be likely less visual quality than the original. These two effects are due to the nature of JPEG compression.
This is not an issue with Thumbnailator, but a general nature of using JPEG image compression.
thank you.
@coobird Hello, I'm Heesu. I would like to ask if it is the same for PNG. Thanks.
Thumbnails.of(input).scale(1.0f).outputQuality(0.85f).toFile("/Users/we/Desktop/output.png");
Before size: 18122 After size: 279584
[input image]
[output image]
code: File file = new File("bailu.jpg"); Thumbnails.of(file).outputQuality(0.9d).scale(1d).toFile("bailu2.jpg");
before size :73kb after size :76kb