And websites like flickr.com give us too many high quality photographs in the public domain. Wouldn't it be wonderful if it were possible to somehow process these images to make our own image collections?
As always linux does not disappoint. The plethora of powerful command line tools like xloadimage, xli, qiv, xv, ImageMagick open up a world full of possibilities.
ImageMagick is a suite of command line tools like montage, convert, display and so on. Many of these tools can help you display images in various ways, on the root window , tile them, stretch them, rotate them and so on.
Image formats are dime a dozen and most digital cameras give you jpeg files to play with. You can use the convert program to obtain any other format you desire. One thing to bear in mind is that with all raster formats, scaling loses resolution. Whereas vector graphics formats like svg and eps don't.
Convert is simply used like this.
$ convert img.xpm img.pngXPM is a an X Window picture format and XWD is an X window dump format which all have lot of information which can be compressed into png or jpg.
xwd is a very simple and effective tool for taking screenshots of linux desktops and the dump file can be further processed with any of the tools above.
No article on image processing can be complete without a mention of gimp but I leave it out as it is heavy duty for most day to day tasks.
qiv is the fastest way to display an image and one fun thing to do would be get a dump of frames from a video with mplayer and type
# getting a dump from mplayerAnd press the SPACE bar. You can really see the principle of persistence of vision in action. Try it!
$mplayer -vo jpeg video.avi
#viewing images with qiv
$ qiv *jpg
qiv helps you change the brightness, contrast, flip the image, make a mirror image with simple keyboard shortcuts. Pressing 'h', 'k', 'v' and 'l' will rotate the images in various ways. 'c', 'C', 'b' and 'B' can be used for reducing or increasing the contrast and brightness of images.
It is not much fun just to display images. We also want to be able to generate collages of images, save images that are processed in various ways. convert is very handy for this. You can correct the gamma of images if required.
xli is really great when it comes to displaying huge images especially from digital cameras. qiv chokes or rather struggles with big pictures as its algorithm is suited for speed rather than accuracy. xli and xloadimage can help you do some really cool things with your images.
ImageMagick has extensive documentation and its feature list is so big that even a tool like xv cannot match.
You can generate thumbnails from your photo stream by piping the images to the convert tool.
I once generated a collage with gimp but nowadays prefer tgif for it. You can also crop unnecessary parts easily with tgif. You can add textannotations easily with tgif.
I shall end this article with a nice way to generate your own image slideshow video with mplayer.
$ mencoder "mf://*.jpg" -mf type=jpeg fps=0.5 -o image-video.avi -ovc lavc
You can modify the "frames per second(fps)" parameter to show N images in a second. I am comfortable with showing an image for two seconds. You can also add audio to this slideshow with mplex. But that is another matter!
But bear in mind that all images have to be of same dimensions for this to work. Aspect ratio is not only for videos.