Most of us probably know how wonderful a tool Gimp is for editing images, but have you ever thought about manipulating image files on the command line? If not, let me introduce you to the convert command. It easily coverts files from one image format to another and allows you to perform many other image manipulation tasks, as well \u2014 and in a lot less time than it would take to make these changes uses desktop tools.\nLet's look at some simple examples of how you can make it work for you.\n\nConverting files by image type\nCoverting an image from one format to another is extremely easy with the convert command. Just use a\u00a0convert command like the one in this example:\n$ convert arrow.jpg arrow.png\n\nThe arrow.png image should look the same as the original arrow.jpg file, but the file will have the specified file extension and be different in size. The convert command will use the file name you provide (in this case, arrow.png) to determine what type of file you want to end up with and reformat the image accordingly. If you doubt that the proper conversion could possibly happen as quickly and easily as it does, you can always use the od command to examine the beginning of each of your files.\nod -bc arrow.jpg | head -6\n0000000 377 330 377 340 000 020 112 106 111 106 000 001 001 000 000 001\n 377 330 377 340 020 J F I F 001 001 001\n0000020 000 001 000 000 377 333 000 103 000 003 002 002 002 002 002 003\n 001 377 333 C 003 002 002 002 002 002 003\n0000040 002 002 002 003 003 003 003 004 006 004 004 004 004 004 010 006\n 002 002 002 003 003 003 003 004 006 004 004 004 004 004 b 006\nod -bc arrow.png | head -6\n0000000 211 120 116 107 015 012 032 012 000 000 000 015 111 110 104 122\n 211 P N G r n 032 n r I H D R\n0000020 000 000 001 364 000 000 001 167 010 000 000 000 000 166 231 346\n 001 364 001 w b v 231 346\n0000040 040 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141\n 004 g A M A 261 217 v 374 a\n\nYes, convert did all that in a few seconds. The "JFIF" string displayed in the first file and "PNG" displayed in the other verify that the operation performed as instructed. These are the internal codes used to identify these two file formats.\nReformatting large groups of files\nIf you want to use the convert command to generate hundreds of .jpg files from hundreds of .png files (or vice versa), you can use a script like this. Depending on the number of files to be converted, it still will likely take only take a matter of seconds or possibly minutes to complete the task.\n#!\/bin\/bash\n\nfor file in `ls *.png`\ndo\n newfile=`echo $file | sed 's\/png\/jpg\/'`\n convert $file $newfile\ndone\n\nNote: Use sed 's\/jpg\/png\/'\u00a0if you want to convert jpg files to .png format.\nWhile I'm only showing .png and .jpg files in these examples, convert will work with other image types as well (e.g., .bmp, .gif and .tif).\nRotating and flipping\nTo rotate a file, you need to tell convert how many degrees to rotate it. The first of the two commands below will rotate an image 45 degrees in a clockward direction. The second uses the -flip option to turn it upside down.\n$ convert arrow.jpg -rotate 45 arrow45.png\n$ convert Sandra_Simpson.png -flip Sandra_flipped.png\n\nNotice that in the first command we're doing the rotation and the conversion to a .png file with a single command.\n Sandra Henry-Stocker\nKeep in mind that a 180-degree rotate and a flip are not the same thing. The rotate command will create an image that looks like you've spun the original image around halfway. The flip will create mirror image of the original image.\nAnnotating\nTo add annotation to an image, use a command like this one, but make sure the font size works for your image. Note that you should select a text color that will show up on your image and that the size and position of the text must be specified.\n Sandra Henry-Stocker\nThe pointsize setting should depend on the size of your image file. The coordinates are relative to the upper left corner of the image. Experiment with the settings, and you're sure to find some that work well for you.\n$ convert Sandra_Simpson.jpg -font courier -fill black -pointsize 50 -annotate +50+50 'My Simpsons Look' Sandra_annotated.jpg\n\nAppending\nIn this command, we're appending two images together to form a single image.\n$ convert Sandra_Simpson.png Sandra_flipped.png -append appended.png\n\nThe original and flipped images are appended \u2014 one on top of the other.\n Sandra Henry-Stocker\nMany other options ...\nThe Convert - Linux man page says the command can "convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more" \u2014 and that's no exaggeration. While the basic operations are extremely fast and easy to perform, the huge variety of image manipulation options is somewhat mind boggling. Install the program and experiment with some sample images, and you'll slowly discover many options that you will enjoy using.\nWrap-up\nOnce you decide what kind of image manipulation you want to perform and work out the command that makes the intended changes for you, you can run through a set of files with surprising speed \u2014 much faster than making the same type of changes using Gimp. The convert command is a real winner for the "no artistic skills needed" kind of image manipulation.\nI hope you enjoy working with the convert\u00a0 command. And now you know what I'd look like as a Simpson!