Thursday, August 21, 2014

Thumbnailator to create a thumbnail.

Many time for the existing images or new images you have to create a thumbnails. This can be achieved by using the Thumbnailator API. Please refer to the following code to create a thumbnail from the source image. You can specify the thumbnail size and also the background color. Documentation for the Thumbnailator can be found here. You can download the jar file from here.

Code to create thumbnail

 Output of the above program is :

Original image size 1600 x 1200 pixels


Thumbnail size 60 x 80 pixels

No comments:

Post a Comment