Wand-mode - image viewer

Wand-mode is the special mode to view and edit images under SXEmacs. Wand-mode is based on ImageMagick API therefore it can perform action usually done by programs such as convert(1), display(1) etc. Wand-mode supports all the formats handled by ImageMagick; there are over 100 formats including PDF, EPS, etc.

Getting started with Wand-mode

Using M-x Wand-display RET /path/to/image.jpg RET we will get something like:

Wand-display sample

To get file info we press i:

Wand-display identify

Now let us enhance this image a little. We want to remove noise and decrease contrast a little. Use o despeckle RET and then o contrast RET decrease RET. Don't worry, completion will work everywhere. We'll get the result:

Wand-display edit

Viewing image directories

Wand-mode has simple yet very handy navigation possibilities to view images. Open any file with Wand-display, if there any other image files (supported by ImageMagick) in the directory, then you can open them using next keys:

Pages navigation

When viewing multi-page images such as PDF, EPS, MPEG, etc you can navigate across the pages with next keystrokes:

Of course Wand-mode is not xpdf or gv, however it is pretty handle to skim over the document or for picking and saving particular page from book or video file.

If you set Wand-mode-show-fileinfo variable to non-nil value, then information about current page and total number of pages will be displayed.

Also note that any operation you apply, applies only to current page and not to whole bunch of pages in the image.

Wand-mode Menu

Wand-mode has nice menu (resembling display(1) menu) to work with images:

Wand-display menu

You can reach menu either from menubar (if enabled), or using right button on your mouse. All commands available through the keyboard are available via menu and vice versa.

Customizing Wand-mode

Wand-mode has few parameters to change it's behavior. Use M-x customize-group RET Wand-mode RET to change them. Here is a little description of most want-to-customize parameters:

Changing image and saving

Use next keys to operate on images:

You can apply operations one by other, like we already did. All operations are stored in image operations stack, so you can undo/redo any using standard C-/ (or C-_) and C-x C-/ keys. Also you can re-apply last operation with C-. (or C-x M-:) key. To abolish all operations just reload image with C-r.

Now when new image is read, we can save it to the disk. There are two commands to do it:

Attention!

ATTENTION: Saving to non-graphical formats such as HTML, TXT, etc, may lead to core dump. This is ImageMagick bug, but unfortunately ImageMagick developers not quite sociable guys, so only god knows when this will be fixed.

Operating on image region

Wand-display region

Using left mouse you can select image region, for example Sarah's hand. If Wand-mode-show-fileinfo is set to non-nil, then region's geometry (coordinates and size) will be displayed, sometimes this useful. When region is active then operations that can be applied to region, such as contrast, despeckle, etc will be applied to region only. There are few commands that are applicable only to regions:

After applying operation to region, region deactivates. To activate last region use C-M-z command.

Red eye reduction

Most important thing in the red eye reduction is correctly selected region. Best way to select region so all red part is in the centre of the region and there is a little free space from red part to the edges of the region. Here is an example of well formed region:

Wand-display red eye good region

And here is not so well selected region, however red eye reduction algorithm will handle it in this case, but in more complicated cases it might produce some artifacts:

Wand-display red eye bad region

After selecting the region simple press . or choose menu item Wand→Region→Remove red eye.

Red eye reduction algorithm used in Wand-mode is straightforward and can't compete with algorithms implemented in professional red eye reduction tools, however it demonstrates pretty good and usable results. Here is the comparison:

Wand-display red eyes sxemacs vs prof

Operations table

To finalize the article, here is brief overview of operations you can do on images using Wand-mode. Notice that operations which does not changes image size can be applied to region without problems:

Transform
Sample
Width: 400
Height: 200
Rotate
Degrees: 120°
Flip
Flop
Effect
Add Noise
Noise type: Poisson
Despeckle
Edge detect
Radius: 1.0
Emboss
Radius: 1.0
Sigma: 2.0
Gaussian Blur
Radius: 1.0
Sigma: 2.0
Radial Blur
Radius: 3.0
Reduce Noise
Sharpen
Radius: 1.0
Sigma: 2.0
Spread
Radius: 1.0
Enhance
Contrast
Type: increase
Contrast
Type: decrease
Enhance
Equalize
Negate
Normalize
F/X
Charcoal
Radius: 1.0
Sigma: 2.0
Implode
Radius: 0.4
Implode
Radius: -0.4
Oil Paint
Radius: 2.0
Sepia Tone
Threshold: 85%
Solarize
Threshold: 50%
Swirl
Angle: 90°
Vignette
Black/White: 10
Wave
Amplitude: 2
Wave length: 10