Need Dev Help for Tiff export workaround

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need Dev Help for Tiff export workaround

Post by fmw42 »

Suppose you ai images are in folder1. Set up a new directory, folder2, to hold the output images so that you do not write over the originals.

Then do

Code: Select all

cd folder1
mogrify -path path2/folder2 -format tiff -density 300 -background white -flatten -compress lzw *.ai
However, I fear, in hindsight, that this will not work, because I do not think it will apply the density before reading the ai files and will try to set it afterwards.


You may have to write loop over all the files in folder1, process them with convert, and write them to folder2

If your files have no spaces, you can do

Code: Select all

cd folder1
list=`ls`
for img in $list; do 
name=`convert $img -format "%t" info:`
convert -density 300 $img -background white -flatten -compress lzw path2/folder2/${name}.tiff
done
The -format "%t" info: gets the filename without the suffix. See http://www.imagemagick.org/script/escape.php

This can be put into a bash shell script with arguments for density and input and output directories.
MADubs
Posts: 36
Joined: 2014-06-18T11:38:08-07:00
Authentication code: 6789

Re: Need Dev Help for Tiff export workaround

Post by MADubs »

This is working perfectly. Thank you for you all your help!
Post Reply