Skip to main content
Inspiring
September 2, 2012
Answered

Help with save as (tiff compression options) javascript

  • September 2, 2012
  • 1 reply
  • 5603 views

Hi can someone please help me alter this script from 'psd' to 'tiff'. I would like the script to specify particular compression options and I'm not sure how.

     var saveFile = new File('~/desktop/'+(new Date().getTime().toString())+'.psd');
      app.activeDocument.saveAs(saveFile);
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

The compression options I would like are as follows

Tiff (8bit)

Image Compression - JPEGG Quality 10

Layer Compression - ZIP

This topic has been closed for replies.
Correct answer OrchidPhoto

OK Thanks Paul. I'll read and have a think about that. Just before I close the discussion, would you give me any pointers on the best scriptable compression method? I don't mind lossy, but need to keep the layers and colour profile. The smaller the better for ftp.

1 reply

Paul Riggott
Inspiring
September 2, 2012

It can't be done. JPEG quality is only valid for JPEG compression.

Inspiring
September 2, 2012

Both those options are available in the tiff compression dialogue in CS5. Once you save CS5 offers you LZW, ZIP or JPEGG options for compression. The JPEGG option seems the most aggressive way to flatten the TIFF while retaining the layers.

Paul Riggott
Inspiring
September 2, 2012

If you look at the Photoshop Javascrip Ref.pdf (cs6) page 186 you will see that it says :-

 

Read-write. The quality of the produced

image, which is inversely proportionate to the

amount of JPEG compression.

Valid only when imageCompression =

TIFFEncoding.JPEG.