PNG exportation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PNG exportation

Sebastien
Hi all,

I noticed that Matlab PNG image exportation brings up to 20% extra compression as compared to ImageJ. Are there different possible compression schemes in the PNG standard?

Best,
Sébastien

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: PNG exportation

Michael Schmid
Hi Sébastien,

as so often, there is a tradeoff between computing time and compression - PNG has a few options for the 'filter' applied:
  http://en.wikipedia.org/wiki/Portable_Network_Graphics#Compression
With trying more of them, one has a better chance to find the best compression. Also the zip compression applied thereafter can compress faster or better, depending on how hard it tries.

Java ImageIO has a parameter to tweak this:
  http://docs.oracle.com/javase/1.4.2/docs/api/javax/imageio/ImageWriteParam.html#setCompressionQuality%28float%29

ImageJ (ij.plugin.PNG_Writer) simply does not care about this parameter.  You are free to write your own version of PNG_Writer with more compression (I guess that it will be slower, however)...

PNG has also the option of interlacings, which affect file size (usually creating a larger file) - I don't know whether ImageIO (and, hence, ImageJ) uses interlacing for PNG, but I think it doesn't.

Michael
________________________________________________________________
On Mar 27, 2013, at 15:21, Sébastien Tosi wrote:

> Hi all,
>
> I noticed that Matlab PNG image exportation brings up to 20% extra compression as compared to ImageJ. Are there different possible compression schemes in the PNG standard?
>
> Best,
> Sébastien

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: PNG exportation

Sebastien
In reply to this post by Sebastien
Hi,

Ok, thanks for the details. Since PNG is a lossless compression format I think it would be good if ImageJ could use the strongest compression by default, even if this would imply a slight computation overhead.

Best,
Sébastien

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html