LinuxAnswers - the LQ Linux tutorial section.
Go Back > Blogs
User Name



Convert and resize images using imagemagick

Posted 05-30-2011 at 11:07 PM by sag47
Updated 05-31-2011 at 02:23 AM by sag47

This past memorial day weekend I took a bunch of pictures which I wanted to post to the web. Web photos are best viewed in 800x600px and I had a lot of them. So I used a simple command to do it.
for x in `ls -1`;do convert -resize 800x600 $x `echo $x | sed 's/.JPG/.png/'`;done
mkdir web_album
for x in `ls -1 *.png`;do convert $x web_album/`echo $x | sed 's/.png/.jpg/'`;done
rm *.png
Now I don't have to spend all my time in Gimp with that simple batch command.
Senior Member
Posted in Uncategorized
Views 4612 Comments 1 sag47 is offline

Batch convert images to PDF

Posted 10-10-2010 at 06:48 AM by sag47
Updated 08-11-2011 at 02:10 AM by sag47

Recently (within the past year) I have helped a user with a problem converting hundreds of images into individual PDF files. I was pleasantly surprised to find imagemagick to effortlessly do this.

Command line tool imagemagick does what you need if they're images.
sudo apt-get install imagemagick
Usage: (coverts all images into one pdf)
convert *.jpg foo.pdf
Usage: (converts each image into an individual pdf)
Senior Member
Posted in Uncategorized
Views 3176 Comments 1 sag47 is offline


All times are GMT -5. The time now is 05:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration