Prabhu R
Prabhu R

Reputation: 14222

Is there some library in Java to compress Png images like pngout?

Is there some library in Java to compress Png images like pngout, pngcrush, optipng which are written in C/C++?

In continuation to what Phil has commented below, what I meant was reducing the file size of the image generated by the ImageIO class in Java by removing information that is not needed, same as what pngout does. When I ran pngout on the images that were generated by ImageIO class I was able to get about 50% reduction in file size (reduction size will vary based on images). So I wanted to know if there is any tool or library that could be interfaced with Java so that image files produced ImageIO class can have their size reduced.

Upvotes: 2

Views: 3374

Answers (2)

lothar
lothar

Reputation: 20209

JMagick provides an object-oriented Java interface to ImageMagick.

ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

Upvotes: 0

justinhj
justinhj

Reputation: 11306

You could call an executable from Java to do the work, or you could wrap the library using SWIG and call it from Java.

Upvotes: 1

Related Questions