|
/SW/graphics:
Fixing Simple Photo Issues at the Command Line
(Without having to startup a huge program like gimp or photoshop.)
These utilities are also drawn from the ImageMagick[1] graphics suite. Imagemagick is available for all of Linux, Windows, and the Mac environment[2]. Some examples:
convert -rotate 90 image1.jpg image2.jpg
for i in *.jpg ; do convert $i -resize 800x800 ../convert-folder/$i ; done
This may take a while if you have a lot of photos. In this example, photos will be resized such that they have a maximum width or heighth of 800 pixels, with no change in aspect ratio.
mogrify -resize 600x500 -quality 70 Gabe.jpg
Note that the key difference between mogrify and convert are that morgify over-writes the original file, and convert writes to a different file.
convert input.jpg output.png
# convert -font helvetica -fill white -pointsize 36 \
-draw 'text 10,50 "This is the annotation text"' \
floriade.jpg comment.jpg
for img in *.jpg ; do convert -sample 25%x25% $img thumb-$img ; done
nice ionice -c3 find . -type f -name "*.jpg" -exec mogrify -resize 200x200 -quality 70 {} \;(Note that "nice" and "ionice" lower the priority of the operations' claim on CPU and disk resources, respectively. Especially useful for a production server.)
I have not yet found an Imagemagick manual that has the gift of making difficult tasks seem easy. Here[3][4][5] are some suggestions for manuals.
[1] http://www.imagemagick.org/script/index.php
[2] http://www.imagemagick.org/script/binary-releases.php
[3] http://www.imagemagick.org/script/command-line-tools.php
[4] http://linux.about.com/library/cmd/blcmdl1_ImageMagick.htm
[5] http://www.imagemagick.org/Usage/
posted at: 09:22 | path: /SW/graphics | permanent link to this entry
/SW/graphics:
Problem: How to Edit / Fax / Print a Web Page
First I used Firefox to print the web page to a postscript file "file.ps". If I just wanted to fax the web site, at this point "ps2pdf file.ps" would generate a "file.pdf" which I could upload to my fax website no problem (ps2pdf comes from the "gs-common" package of the Ghostscript[1] software suite).
However, I want to edit this file first.
I used the "convert" utility from the ImageMagick[2] graphics suite (the "imagemagick" package in the Debian distribution) to "convert file.ps file.jpg". Edit file.jpg with gimp[3]. Then "convert file.jpg file.pdf". Fax or print file.pdf.
[1] http://www.ghostscript.com/awki/Ghostscript
[2] http://www.imagemagick.org/script/index.php
[3] http://www.gimp.org/
posted at: 10:08 | path: /SW/graphics | permanent link to this entry