Comments (4)
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 [email protected]
on 26 Nov 2011 at 8:17
from thumbnailator.
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 [email protected]
on 26 Feb 2012 at 6:59
from thumbnailator.
I have similar problem. Reading png, resizing and then saving as jpg. Result
are also very pure.
Original comment by [email protected]
on 5 Mar 2012 at 12:48
from thumbnailator.
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 [email protected]
on 30 Nov 2014 at 7:12
from thumbnailator.
Related Issues (20)
- No suitable ImageReader found for source data(jpeg Picture format) HOT 2
- How to ensure the GIF dynamic effect after compression HOT 1
- Do you have plans to support WebP, AVIF? HOT 1
- Thumbnail not properly generating from PNG images HOT 2
- Image color loss during conversion HOT 3
- Define an Automatic-Module-Name HOT 1
- the image format webp is not support HOT 5
- No suitable ImageReader found for source data errors HOT 1
- After resize the image is rotated HOT 3
- 300dpi tiff image changed to 96pi jpg but pixel does not chage HOT 1
- Incorrect cropping when specifying sourceRegion and an image that has exif orientation HOT 2
- Multi-threaded processing of images with large pixel width and height leads to memory OutOfMemoryError
- the .pict file is not supported HOT 1
- javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers HOT 1
- Add crop method usage to examples HOT 2
- How to make the image width fixed when the image is scaled HOT 1
- Does the thumbnailator support generating thumbnails for png images? HOT 1
- Conversion error caused by image reading failure
- Native image service unable to compress image
- jpg color turn red HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thumbnailator.