Liquid rescaling help page

The Liquid Rescale plugin is an implementation of the content-aware resizing by seam carving algorithm by Shai Avidan and Ariel Shamir.

It aims at resizing pictures non uniformly while preserving the features of the picture, i.e. avoiding distortion of the important parts of the picture. It can also be used to remove portions of the picture in a consistent way.

It works both ways, but enlarging is better obtained in successive steps. It can be manually instructed about what features of the image should be preserved and which should be discarded.

The plugin works on the active layer. See below for a full explanation of the plugin behavior in presence of selections, floating selections, quickmasks and masks.

User interface description

Select new width and height

In this section it is possible to choose the final size. It is advised to rescale always in one direction at a time. If both the width and the height are changed, rescaling is always performed on the width first, then on the height (for no particular reason). The reverse order can be obtained by simply applying it twice, letting the width unchanged the first time, and the height the second.

Manual feature selection, a quick guide

The easiest way to manually select the features of the image that you want to protect or discard is the following: before invoking the plugin, select the layer you want to resize, create a new transparent layer for feature preservation, set its transparency to around 50% and choose the regions of the image you're interested in by painting them with some full colour, e.g. green. Then do the same for feature discard, maybe using a different colour, e.g. red.

When you're done, select back the original layer and invoke the plugin. In the dialog, activate the feature preservation/discard options and appropriately choose the layers you just painted.

Note that discarding a feature implies that it will be removed if shrinking the layer, but it will be inflated if enlarging it, since it will be treated as unimportant background which can be removed or expanded as needed.

Manual feature selection, full description

In the Feature preservation selection section it is possible to specify if there are regions of the image which should be preserved from modification, by checking the Activate feature preservation box, and by choosing a layer among the ones which belong to the current image (different from the active one, which is to be rescaled) by choosing it in the Available layers box. The intensity of the effect on each pixel is obtained as the average on the pixel's channels, including the alpha channel. Thus for an RGB layer with an alpha channel, the maximum value is achieved on white pixels, while black ones are worth one quarter of the white ones and transparent pixels are ignored. In general, it is advisable to work in monochrome, and modulate the intensity by just the transparency in case fine tuning is needed, e.g. by using the quickmask. The size and position of the selected layer can be arbitrary, the plugin will only use those portions which overlap with the active layer. The Intensity scale can be used as a global parameter to modulate the feature preservation.

The Feature discard selection section is identical to the previous one, but the effect is reversed.

Advanced Options

Update energy at every step. Specifies if the algorithm will update the energy map of the image after each seam removal (image alteration can affect the energy map on which the carving is based).

Resize image canvas. Specifies wether the image canvas should be resized to meet the new size of the active layer. If this option is checked, the active layer will be repositioned to be fully visible.

Resize preserve/discard layers. Specifies wether the layers used to manually select the features of the image will be resized along with the active layer. If this option is checked, those layers will be first cropped to the active layer's size, then they will undergo the same seam carving and inserting process as the active layer.

Select gradient function. It is possible to choose which function is to be used to calculate the energy map of the image. For each pixel in the image, the x,y components of the gradient are computed from the pixel's four nearest neighbors. The exact form of the energy map depends on the choice of the gradient function, and this in turn determines which elements of the image are more important, and should thus be preserved, and which are not, and can be removed (if shrinking) or inflated (if enlarging). Using the Null function in conjunction with the feature preservation selection can be used to override completely the automatic feature detection, thus allowing the user to generate his own energy map.

Behavior in presence of floating selections, selections, channels, quickmasks and masks

If the plugin is invoked on a floating selection, this is immedietely applied and the plugin continues to work on the result (a layer or a channel)

In case there is an active selection, this is copied to a channel for backup and cleared. The channel is ignored.

If the plugin is invoked on a channel, this is un-selected and ignored, and the plugin continues to work on the active layer. The same applies to quickmasks, as they are special kinds of channels.

In the case in which the layer on which the plugin is invoked has a mask, or if it is directly invoked on the mask, the interface dialog will offer the choice between discarding the mask or applying it before the rescaling algorithm is applied.