How to improve the performance of g.drawImage() method for resizing images

后端 未结 12 1511
面向向阳花
面向向阳花 2020-11-27 11:16

I have an application where users are able to upload pictures in albums but naturally the uploaded images need to be resized so there are also thumbs available and the shown

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 12:01

    You will ever have a trade off between the speed of the resizing and the quality of the resulting picture. You might try another scaling algorithm of the JDK.

    The best and most flexible tool for image editing AFAIK is ImageMagick.

    There are two interfaces for the Java Language:

    • JMagick - is a JNI Interface to ImageMagick. See the projects Wiki to get more information.
    • im4java - is a command line interface for ImageMagick. It is not, like JMagick, based on JNI.

    You should prefer im4java before using the command line directly to call ImageMagick.

提交回复
热议问题