Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 17, 2024
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)

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.