RealWorld Designer

Discover what’s the RealWorld all about.

Archive for November, 2007

Scripting out of control

Tuesday, November 27th, 2007

I had it coming…I should have never unleashed it. The scripting interface in RealWorld Designer took a sharp turn and became a lot more than was originally planned.

Do you want to rotate pictures by EXIF tags? Generate thumbnails and code for html galleries? Watermark and decorate pictures? Or… do it all in one step? Well…why should I care? You can do it yourself using scripts.

Plug-in based scripting?

Almost anything in RW Designer makes use of plug-ins, so why not scripting? A scripting plug-in can do two things: First, it may introduce a global object with methods and properties accessible from script and second, it may make certain functions of a document callable in the script.

An example of the first case is the Blender object, which enables users to create a temporary canvas and combine contents of canvases and real image documents using given blending operation.

An example of the second case is the EXIF wrapper, which can be used to manipulate EXIF tags of a document from script.

Interactive scripts

Most of image filters are configurable and it would be silly if scripted operations were not configurable. Fortunately, they are. It is possible to specify a couple of parameters that the user may change when the script is executed. The configuration dialog may contain edit boxes, sliders, color pickers, combo boxes and check boxes. The dialog may also contain a preview window.

The image below is a scripted operation in action. Note the 3 sliders by the bottom edge of the window. Each one of them controls what values are added or subrtacted to/from the red, green and blue channels.

Configuration dialog of a scripted operation.

As a side effect, the scripted configuration can be used to limit or customize confguration of an ordinary image filter. You may for example create a sharpening filter (that uses the generic convolution image filter) and is controlled by a single “magnitude” slider.

Example

Let’s have a look at a simple example. Imagine, you have a digital camera that is able to record the orientation of a photo to the EXIF tag (this feature is not uncommon anymore). The following script will automatically rotate the image according to the value of the “Orientation” EXIF tag. It is of course possible to use the operation in batch mode to rotate all your photos at once.


if (Document.EXIF.Exists)
{
var orientation = Document.EXIF.GetValueByName("Orientation");
var angle = 0;
if (orientation == 'bottom - right')
angle = 180;
else if (orientation == 'right - top')
angle = 90;
else if (orientation == 'left - bottom')
angle = 270;
if (angle != 0)
{
var rotation = Operation.Create("Raster Image - Rotate");
rotation.Angle = angle;
rotation.Resize = true;
Operation.Execute(rotation, Document);
Document.EXIF.SetValueByName("Orientation", 'top - left');
}
}

Is that all?

No, of course not. The possibilities of the updated scripting system are quite numerous and in certain aspects, they even surpass the scripting subsystems of Photoshop or GIMP. You can open, modify and save documents, open new windows, use operations and drawing tools and if everything else fails, you can create your own scripting plug-in.

Greenfish Icon Editor Pro

Monday, November 12th, 2007

Free icon editors have been growing like fruits on the trees this year. Greenfish Icon Editor Pro is the second free icon editor released (the first being IcoFX). And both of them are quite good…

This blog is focused on development of our own graphics software, but starting today some space will be given to notable 3rd party software as well. After all, learning more about the real world is beneficial for both users and developers of graphics apps. Today, I have downloaded and tested the Greenfish Icon Editor and was positively surprised.

Basic features

Using hue shift filter in Greenfish Icon Editor Pro

  • Opening and saving in ICO, CUR, PNG, XPM, BMP and JPEG formats.
  • Creating icons up to 256×256 @ 32-bit including Vista(tm)-compatible, PNG compressed icons.
  • Extracting icons and cursors from executable files.
  • Dynamic color depth: you do not have to specify it explicitly, Greenfish Icon Editor will determine it for you.
  • Drawing lots of kinds of gradients.
  • Filters including Remove matte, Drop shadow, Inner/Outer glow and Bevel.
  • No installation required, Greenfish Icon Editor Pro is absolutely portable.

Home page: http://greenfish.extra.hu/downloads.php

Pros and cons

The most notable feature of GFIE is the ability to work with arbitrary selections. Having a good selection tool can make many icon retouching task easier. Color of the hills on the screenshot above shows a colorize filter applied on the selected area. As far as I know, Greenfish Icon Editor has the most advanced selection handling of ALL the icon editors available today.

Another unique feature of the editor is that you need not explicitly define the color depths of the images. The editor will save the image using the least color depth possible. Whether this is a good thing or not remains to be seen.

The editor has no apparent weak points. You’ll find all the usual tools, a color picker, a couple of gradients for shape filling and all the basic image filters.

The software is relatively new and focuses on its core functions, missing the bells and whistles the older icon editors have collected during their evolution. That means no batch operations, no Windows icon customization and no icon library management. This is not necessarily a bad thing, sometimes it is better to focus on one area and not spend time creating almost useless functions just because the others have them.

Summary

As an author of a commercial icon editor I should be worried about the fact that there are now two very good and free icon editors available. Fortunately, we have a couple of unique features left in the area of image-to-icon conversion and integration of 3D tools, but things are a lot more interesting with such a good and free alternatives. Isn’t competition a great thing?