Linux Blog

Command Line Image Editing with ImageMagick

Filed under: Linux Software — TheLinuxBlog.com at 1:52 pm on Friday, February 13, 2009

Image Magick

Image editing is often considered a pitfall of the Linux desktop. When I was in school a number of years ago a Windows user (that later converted to the hipster OS X “better than thou” type) said to me:
“I don’t know why any one uses the command line anymore, it’s obsolete”
People often forget about the power of the command line. The command line may not be the best utility for everything but image editing is a shining example of how it can be used. I wouldn’t recommend trying to type a command that touches up your photos, but any operation that has to be repeated a number of times can be easily accomplished through a series of commands.

While there are many command line image editing tools available, this post focuses on the ImageMagick suite. While all of this can be read in the man page I aim to simplify and document for both myself and other casual ImageMagick users. By far the most valuable resource for ImageMagick is the online documentation.

Basically ImageMagick takes a number of parameters depending on the function you are to perform. Most commonly an input filename, an operation and an output filename. You can specify the same filename for both input and output in most cases, unless you are trying to keep the source image in its original form.

Here are some of my favourite and most used functions of imagemagick:

Resize an image
To resize an imagemagick is very simple. Using convert you specify the -resize option. You have several options when resizing, resize by width or height. You can also resize while adding a background color if your image has strange dimensions

Rotate an Image
Rotating an image is a snap, using convert with the source file -rotate <degrees> out file you can rotate by any number of degrees. 90, 180, 270 are most common, to change orientation but other angles may be used. Keep in mind that you may want to set a background color to do this.

Flipping an image
There are two ways to flip and image and they get sort of confusing. Imagemagick uses -flip for vertical images and -flop for horizontal flipping.

Quality
Adjusting the quality of an image is sometimes desirable for saving files to the web. Use -quality <0-100> (100 being the best) to adjust the quality

Working with GIFS
Gif’s can be edited or created by those patient enough to do so. The major think about working with gifs is the -coalese option. This takes each frame from the gif and makes it its own image. Be careful when using this as it will make Filename.gif Filename-1.gif, Filename-2.gif, Filename-3.gif and overwrite those files if they already exist. You can then work on each frame individually, or with a script and then join them back together.

New Linux Desktop

Filed under: Linux Hardware — TheLinuxBlog.com at 5:50 am on Wednesday, February 6, 2008

I got a new Linux desktop for use at my office.  All right, so its not entirely new but the price was right!

Here are the specs:

Motherboard: MSI K9N6SGM
CPU: AMD Sempron 3400+ 256 KB Cache, 1808.430 MHz and 3620.23 Bogomips (Slightly more than my laptop)
Ram: 1GB Generic Ram
Hard Drive: 80GB Sata Drive
Power Supply: 350 Watt

Now, considering I only paid around $200 for all of this I think I did pretty good. I already had an fairly new e-machine that was given to me with a fried motherboard, power supply and hard drive, so I used the Case DVD, Rom and CD-RW drive. Its a pretty fast machine so far. The onboard video happens to be a GeForce so I’m happy about my 3D Graphics support.

What is even better is that if you would like to support The Linux Blog and happen to need a new computer, you can call The Tech Fellows at (704) 780-4932 and tell them that The Linux Blog sent you and they will hook you up. Even if you just need parts they can help and normally can match Tiger Directs prices.

I will let you know how the rest of the installation of Slackware goes and post some benchmarks some time.

My Linux Desktop Machine

Filed under: Linux Hardware — TheLinuxBlog.com at 8:39 am on Saturday, November 24, 2007

Maybe its just me but I find it interesting to look at other peoples computer stuff so I’m going to take the time to write some blog posts about my hardware.

First in my lineup is my Desktop. This is by no means a new computer but runs very well.
CPU: AMD Athlon XP 2500+
Motherboard: MSI KT400
Memory: 512MB DDR 333
Hard Drive: 160GB Maxtor
Video Card: NVIDIA GeForce FX5200
Ethernet: ADMtek NC100 Network Everywhere 10/100
Media Devices: CD-RW, Floppy, ATA133 Hard Drive Bay
Monitor: LG 19″ Flat Panel. DVI, VGA, 1280×1024. 4ms 1400:1
Keyboard/Mouse: Generic Staples $10 special and a unknown brand painted laser mouse.

Every device is supported by the 2.6 kernel and Linux runs very well on it. The motherboard uses a VIA chip set and a C-Media audio device. The CPU is
actually 1875.733 MHz with a 512KB cache. According to cat /proc/cpuinfo it has a bogomips rating of 3754.8

Now comes the sensitive part, my distro of choice. For some this is a sour topic but I’ll just say that it doesn’t really matter to me. I run windows on it before and most Linux distributions out perform it out of the box (after installing video drivers.) I choose to run Slackware 12 on it because of the simplicity. It took a little while to configure it how I like but it turned out pretty well. I use slackpkg to keep it current.

I’ll be sure to post some pictures of the setup some time.

Thats about all I have to say about my desktop, if you have any questions or would like any additional information just give me an e-mail at: owen @ thelinuxblog.com