Howto: Linux convert an image between different formats from command prompt
Q. How do I convert images from a shell prompt? For example convert an image in the JPEG format to PNG or vise versa?
A. You need to use the convert command which is a member of the ImageMagick suite of tools. Use it to convert between image formats as well as
=> Resize an image
=> Blur an image
=> Crop an image
=> Despeckle an image
=> Dither an image
=> Draw on an image
=> Flip an image
=> Join an image
=> Re-sample, and much more.
Task: Convert an image in the JPEG format to PNG
Type the command as follows:
$ convert input.jpg output.png
Task: Resize the image
Resize and convert an image in the JPEG format to PNG
$ convert -resize 50% input.jpg output.png
You can also create a complex effect such as:
$ convert -size 360x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 -draw "text 25,60 'nixCraft'" -channel RGBA -gaussian 0x6 -fill YellowGreen -stroke RosyBrown -draw "text 20,55 'nixCraft'" nixCraft.png
Output:

E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Redhat Enterprise Linux (RHEL) install ImageMagick RPM for manipulating images
- Howto open .daa files (Direct-Access-Archive) under Linux / UNIX
- Howto: UNIX or Linux convert DOS newlines CR-LF to Unix/Linux format
- Shell Scripting: Convert Uppercase to Lowercase
- pdfimages: Extract and Save Images From A Portable Document Format ( PDF ) File
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!




May 24th, 2007 at 6:45 pm
[...] sin necesidad de tener instalado ningun programa en tu computador, aunque nunca esta de menos comentar la brutal utilidad convert y algunos ejemplos de uso [...]
April 18th, 2008 at 12:12 pm
This website is the best …website for linux users.
Thanks to Nixcraft.