LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Convert and resize images using imagemagick

Posted 05-30-2011 at 10:07 PM by sag47
Updated 05-31-2011 at 01: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.
Code:
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 7812 Comments 1 sag47 is offline
Old

DVD Ripping

Posted 04-25-2011 at 10:54 AM by sag47

I work for a Scientific Institution and a company which recorded talks decided to give us all the talks in DVD format instead of a hard drive full of video files. This is kind of counter intuitive however luckily I use Linux at work. Long story short mencoder with lame installed solved my problems.

Code:
mencoder 
-vf harddup 
-vf-add smartblur=.6:-.5:0,unsharp=l5x5:.8:c5x5:.4 
-xvidencopts fixed_quant=4:profile=dxnhtntsc 
-lameopts cbr:br=128:aq=0:vol=1
...
Senior Member
Posted in Uncategorized
Views 6746 Comments 1 sag47 is offline
Old

batch resize images using find, xargs and convert

Posted 02-20-2011 at 04:30 PM by dr_agon

applies to: linux, find, xargs, convert, image processing

'convert' command, which is a part of ImageMagick package can be used for image resizing, but it lacks ability to process multiple files (in version of ImageMagick 6.5.7-8 2010-12-02). Instead of writing a shell script you can use find and xargs commands to collect filenames and invoke convert with one filename at a time, like this:

Code:
find -iname "*.jpg" -printf "%f\0" \
 | xargs -0 -I {} convert
...
Member
Posted in Uncategorized
Views 8202 Comments 0 dr_agon is offline
Old

Batch convert images to PDF

Posted 10-10-2010 at 05:48 AM by sag47
Updated 08-11-2011 at 01: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.
Installation:
Code:
sudo apt-get install imagemagick
Usage: (coverts all images into one pdf)
Code:
convert *.jpg foo.pdf
Usage: (converts each image into an individual pdf)
...
Senior Member
Posted in Uncategorized
Views 6903 Comments 1 sag47 is offline

  



All times are GMT -5. The time now is 02:48 AM.

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