pwd
cd folder-name-here
cd ..
sudo port install ImageMagick
to install ImageMagickmogrify -help
and see if anything happens. If you don't get a 'function not found' error, the install has worked!pwd
cd folder-name-here
cd ..
/cygdrive/c/your/path/here
; e.g. cd /cygdrive/c/Users/myUsername/Downloads
could be the thing you need to access your Downloads foldermogrify -help
and see if anything happens. If you don't get a 'function not found' error, the install has worked!cd
to navigate to the folder containing the images you want to convertmkdir output
to create a folder called 'output' where the new images will be saved-format
flag. Typing the line mogrify -path output -format png *jpg
into your command window (Terminal or Cygwin) and pressing enter will take all the JPEG files in your current folder, convert them to png, and save the outputs into the folder 'output'
mogrify -path output -format tif *png
will convert all the PNG files in your current folder to TIFF and save the outputs in the folder 'output'
cd
to navigate to the folder containing the images you want to convertmkdir output
to create a folder called 'output' where the new images will be saved-resize
flag. With the resize flag, you specify a size and the image is resized to fit (not fill) that size. Typing the line mogrify -resize 940x8000 -path output *png
into your command window and pressing enter will take all the PNG files in your current folder, resize them to the largest size that fits inside a rectangle of width 940px and height 8000px, and save the outputs to the 'output' folder. For all but very, very tall images, this will be the same as changing the width to 940 px (and if you comic is very tall, just replace 8000px with a higher number until it works).
mogrify -resize 1200x8000 -path output *jpg
will convert all the JPG files in your current folder to fit inside a rectangle of size 1200x8000 and save the result to the 'output' directory
mogrify -path output -format tif -resize 1200x8000 *png
changes all the PNGs in your current folder to TIFFs, resizes them to fit inside the rectangle of width 1200 px and height 8000 px, and saves them to the 'output' folder.
cd
mkdir thumbnails
and pressing enter-gravity
flag. For instance, mogrify -gravity northwest -crop 300x300+0+0 -path thumbnails/ *tif
takes all the TIFF files in your current folder, cuts out a 300 px by 300 px square from the northwest corner, and saves the output to a folder called 'thumbnails' mogrify -gravity center -crop 300x300+0+0 -path thumbnails/ *png
takes a 300 pixel square from the center of all the PNG files in your folder and saves it to the 'thumbnails' folder
for i in 500 940 1000 1200 1500; do
mogrify -resize "$i"x10000 -quality 100 -write output"$i".png input-image-name.png;
done
In the above, 500 940 1000 1200 1500
are the widths I want to resize my image to (The 10000 pixels part is a filler height I put in to make sure that the resized image matches the desired width; it's just there to be big). My input image name is 'input-image-name.png' and the output of running this code are five PNG files, named output500.png, output940.png, output1000.png, output1200.png, and output1500.png.
count=0;
initialDay=1;
for filename in input/*; do
echo "$filename";
shift=$((initialDay + count*7));
i=`date -v +"$shift"d "+%y%m%d"`;
echo "$i";
count=$((count+1));
mogrify -resize 1200x20000 -format tif -write comic"$i".tif "$filename";
done