We are using IM4Java library for creating thumbnails. Our code snippet is given below.
Code: Select all
IMOperation op = new IMOperation();
op.addImage(sourceFileName);
op.thumbnail(Integer.parseInt(dimension.getWidth()));
op.addImage(destinationFileName);
try {
cmd.run(op);
} catch (Exception e) {
log.debug(e.getMessage());
}
Now in one scenario my thumbnail size (not dimension) is not reduced very much.
My Original image is JPG image with dimension 1306x979 and size 3.64 MB.
I created its thumbnail in dimension 200x150 but its size is 2.65 MB.
On the other hand, when we created same dimension thumbnail using Photoshop its size was just 11 KB.
Where as for another JPG image of size 3.72 MB, its creating thumbnail of size 553 KB.
I think the size of every thumbnail should be below 20 KB as per targeted dimension i.e. 200x150.
Please suggest which option of ImageMagic should we use?
Regards,
Krishan