Save compressed tiff by macro

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

Save compressed tiff by macro

Peter van Loon
Hi,

If I use the 'SaveAs' -> 'Compressed Tiff' (ZIP and Huffman RLE selected) by menu I get my lossless compressed tiff file. If I use the recorded macro version of it I get a regular uncompressed version. How can I add this ZIP compression in the macro?

This is the recorded macro stringwhen executed by menu:
run("Compressed TIFF ...", "save=[Z:\\Test compr.tif] imageiosaveas.codecname=tiff imageiosaveas.filename=[Z:\\Test compr.tif]");
It is logic that it is uncompressed because I don't set this in the macro but how can this be done?

Peter
Reply | Threaded
Open this post in threaded view
|

Re: Save compressed tiff by macro

Rainer M. Engel
Hi Peter,

if you want to stay with your images within the domain of ImageJ you
could work with "SaveAs" -> "ZIP". This is not that clever for other
software (At least in my opinion), but it has the advantage of saving
extra space since the compression is overall and not based on sets of
scanlines.

Alternatively I like using PNG which is also capable of higher bit
depths and compatible over all tools we use here (incl. lossless
compression).

I guess the problem to record that output properly is related to that
I/O-Plugin.
http://ij-plugins.sourceforge.net/plugins/imageio/index.html

I guess it is that one and if - it was written by Jarek Sacha
([hidden email]). Maybe he can help or provide an update sometime.

Regards,
Rainer


Am 07.03.2014 08:59, schrieb Peter van Loon:

> Hi,
>
> If I use the 'SaveAs' -> 'Compressed Tiff' (ZIP and Huffman RLE selected) by
> menu I get my lossless compressed tiff file. If I use the recorded macro
> version of it I get a regular uncompressed version. How can I add this ZIP
> compression in the macro?
>
> This is the recorded macro stringwhen executed by menu:
> /run("Compressed TIFF ...", "save=[Z:\\Test compr.tif]
> imageiosaveas.codecname=tiff imageiosaveas.filename=[Z:\\Test compr.tif]");/
> It is logic that it is uncompressed because I don't set this in the macro
> but how can this be done?
>
> Peter
>
>

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

Re: Save compressed tiff by macro

Peter van Loon
Hi Rainer,

Thank you for your suggestions. I didn't think on the ZIP option. It works but is not practically if I want to see them in an image viewer. My images have two layers so I can't use PNG because it flattens the image to one layer.

I tried the Bio-Formats Exporter but it gave exception errors (in my FIJI version).

I just tried the Bio-Formats Exporter in older and more clean ImageJ and FIJI versions and it works.
The Bio-Formats Exporter is recordable and contains the compression method:

run("Bio-Formats Exporter", "save=[Z:\\Test BioFormats LZW compr by macro.tif] compression=LZW");

I my case uncompressed Tiff images are 13MB and LZW compressed: 0.6MB so I save a lot of space and images are opened faster.

Regards,
Peter