resizing pictures with ImageMagick
hey everyone,
I found this app for resizing images. for some reason my camera took pictures in huge sizes (3000+ pixels) and I need to resize them to a normal size. so, I found this prog which does a great job with the 'convert' command. i'm trying to make it convert all the pictures in one command. its syntax is: convert -resize size pic.jpg newpic.jpg I tried by this: ls > convert -resize 800 .. but i've no idea how to specify its output. any ideas? |
Congratulations on discovering one of the major power tools!!
First, your camera has settings to control the output file size. Personally, I alway set it on the highest quality (largest file) and then downsize later. From your command, it appears you are trying to do batch resizing. Try it your way, and I think it will simply assign its own filenames in some undesirable way. Much better to loop thru the folder---something like this: <<untested>> Code:
for pic in *; do |
A google search at www.google.com/linux (for Linux related searchs) turns up quite a bit about resizing with Imagemagick. Just search for: imagemagick howto resize
|
Thanks.. I think its working now. by saying batch you mean write a shell script right?
and can you please explain a lil bit how this small script works? how does the var $pic gets its value? thanks again, much appericiated. saved me tons of time now editing them one by one :) |
The for loop assigns as value to the stated variable each time thru the loop.
General syntax: for <variablename> in <expression>; do <stuff to do> done <expression> can be as simple as the "*" (in this context meaning "everything I can see") or it can be the result of a command Suppose you wanted only the files with names starting with "G". The loop would start with: for <variablename> in $(ls|grep "^G") For more on BASH scripting, head over to http://tldp.org and get the Bash Guide for Beginners |
thanks alot pixellany for the explanation.
|
Quote:
http://polishlinux.org/apps/graphics...h-imagemagick/ |
All times are GMT -5. The time now is 04:48 AM. |