Save compressed Tiff in ImageJ

Hello @dgault @ctrueden,

Is it possible to save compressed Tiff from the ImageJ UI?
I would be bet a lot that it is, but I just cannot find it…

Tischi

If you use the Bio-Formats Exporter it will give you a dialog with a drop down of the available compressions for the export format (the dialog will not be present if the format only supports 1 compression type).

1 Like

Thanks!
What are your thoughts about JPEG2000?
It takes really long and does worse than LZW in my case.

Anecdotally the most notable difference is that the compression and decompression time for JPEG-2000 does tend to be much longer than LZW. In terms of file size they seem to be comparable and with in the same ball park for the most part.

Running a quick test against some sample data (https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/tubhiswt-4D/) and the LZW provided slightly better compression (157MB vs 192MB) but substantially better processing time (Uncompressed took 11s, LZW took 21s, JPEG-2000 took 90 min). The compression sizes will all be very dependent on the actual data source though but I think its fair to see that in terms of processing time JPEG-2000 performs much worse.

2 Likes

That seems excessive. For comparison, using Python/tifffile/imagecodecs/OpenJPEG it takes uncompressed < 1s, ZIP ~15 s, and JPEG2000 ~26 s to resave the tubhiswt-4D dataset as multi-page TIFF.

1 Like

Yeah, what I overlooked the first time and is worth noting is that changing the tiling size used will also drastically impact on the effects. For example JPEG-2000 on the same fileset when tiled with resulted in 104MB and around ~50s (so significantly improved over the untiled option) and LZW when tiled was 116MB and 9s. Various tiling options will likely lead to different results depending on the input data and compression type.