GithubHelp home page GithubHelp logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.