Open GoogleCodeExporter opened 9 years ago
Thank you for the detailed report.
I'll have to take a closer look at where the image is becoming unsatisfactory,
and if there are any workarounds which can be put in place to improve image
quality.
There are two places that I can think of at the moment that can be causing
problems.
1. The image resizing step -- perhaps increasing the color depth from 8-bit to
a 32-bit ARGB (or 24-bit RGB) may improve the result.
2. The image encoding step -- it's possible that even feeding a 24-bit image
into the PNG encoder (the default which comes with the Java runtime) may result
in a poor image. There may be settings to improve the downsampling that I
haven't taken a look at yet.
I'll have to investigate further to see if there's anything that can be done to
improve the image quality of the resulting thumbnail.
Once again, thank you for reporting this issue.
Original comment by coobird...@gmail.com
on 26 Nov 2011 at 8:17
Sorry for the delay in the follow-up.
There is a workaround to this issue, as long as the resulting PNG can be a
24-bit image (with transparency):
Thumbnails.of("original.png")
.size(80, 80)
.imageType(BufferedImage.TYPE_INT_ARGB)
.toFile("thumbnail.png");
The `imageType` method can be used to specify the thumbnail's image type. In
the above code, the output format will be a 24-bit RGB image with a
transparency channel.
The catch is that the resulting thumbnail will have a file size that is larger
than the original, and the bit-depth will no longer be 8-bit.
If there is a requirement to keep the thumbnail as a 8-bit image, then the
internals of Thumbnailator will have to be modified.
Original comment by coobird...@gmail.com
on 26 Feb 2012 at 6:59
I have similar problem. Reading png, resizing and then saving as jpg. Result
are also very pure.
Original comment by marcin.m...@gmail.com
on 5 Mar 2012 at 12:48
Very bad output on PNG resizing, basically useless.. I'm going to have to
either switch everything to JPG or find something else.
Original comment by ottersl...@gmail.com
on 30 Nov 2014 at 7:12
The Thumbnailator project will move to GitHub due to Google Project Hosting
going read-only in one month.
http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
This issue has been migrated to GitHub at the following URL:
https://github.com/coobird/thumbnailator/issues/26
Original comment by coobird...@gmail.com
on 25 Jul 2015 at 11:37
Original issue reported on code.google.com by
will.t...@xtremelabs.com
on 16 Nov 2011 at 3:41Attachments: