Comments (2)
I changed the code to
Thumbnails.of(srcImage).size(80,80).outputFormat("gif").toFile(new
File("/Users/hi/Desktop/1.gif"));
specified the output format to gif, and replaced '.width(200)' with
'.size(80,80)'
but the quality still low (1.gif)
the 3.gif was created by another 3rd part imaging library
Original comment by [email protected]
on 20 Jan 2014 at 3:40
Attachments:
from thumbnailator.
Thank you for filing this issue.
I have been able to reproduce this issue, and turns out there is a workaround:
Thumbnails.of("original.gif")
.size(80, 80)
.imageType(BufferedImage.TYPE_INT_ARGB)
.toFile("thumbnail.gif");
The issue appears to be that internally, Thumbnailator is resizing the 8-bit
image itself, which can cause low quality image resizing.
(Note: This is a similar issue to Issue 26.)
The `imageType(BufferedImage.TYPE_INT_ARGB)` method call forces Thumbnailator
to convert the original image to a 24-bit image with transparency when
performing the resizing operation which leads to the better resize quality.
Also, just to note, Thumbnailator will do its best to try to determine the
output format from the file name (if a file name is provided), so at least in
the case you've presented, using `outputFormat("gif")` is not necessary.
Although this does not directly address the issue (there shouldn't be a need to
call the `imageType` method -- Thumbnailator should be smart enough to do it
automatically) so I'm going to leave this issue open.
Original comment by [email protected]
on 31 Jan 2014 at 4:12
- Changed title: Low quality when resizing a GIF image
- Changed state: Accepted
from thumbnailator.
Related Issues (20)
- Watermark position incorrect for images re-oriented using EXIF metadata HOT 3
- Move to GitHub (and transition to a Git repository) HOT 5
- Change build from Ant to Maven HOT 4
- Google Project Hosting will drop support for Downloads HOT 3
- Using JAI library? HOT 1
- Thumbnailing problem for a specific JPEG image HOT 1
- OutOfMemoryError: Java heap space / Builder.asBufferedImage HOT 3
- Exception on opening nested folder HOT 5
- Recursively process images in nested directories
- Unexpected behaviour when using toFile without an extension matching output format HOT 1
- Support animated GIFs HOT 2
- Javadoc on Thumbnailator class has unclear remark on OutOfMemoryError HOT 3
- Implement a workaround for common OutOfMemoryError cases HOT 15
- java.lang.OutOfMemoryError: Java heap space after adding thumbnailator-feature-oom-workaround-SNAPSHOT.jar file HOT 6
- Please retain debug information in published JAR HOT 3
- forceSize Not maintaining the Aspect Ratio of thr original image HOT 5
- "Image cannot be null" when using `Thumbnails.of(BufferedImage...)` HOT 2
- Use embedded thumbnail from large JPEG images HOT 1
- SVG not supported
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.