Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

Behind the scenes

Offset, Minimum, Maximum and convolution in Paint by Zaweba

Four technical filters in Paint by Zaweba: Offset for tiling, Minimum and Maximum for shrinking and growing masks, and Custom Convolution for your own kernels.

Offset, Minimum, Maximum and convolution in Paint by Zaweba

Some filters are not effects at all. They are tools, the kind you reach for while building a texture, tidying a mask or experimenting with how image processing works. Paint by Zaweba keeps four of these together: Offset, Minimum, Maximum and Custom Convolution.

Offset

Offset slides the picture sideways and up or down. What happens to the part pushed off the edge depends on the option you pick. It can wrap around to the other side, repeat the edge pixels, or leave the gap transparent.

Wrap around is the one texture makers use. Making a tileable texture by hand starts with Offset by half the width and half the height: the seams that were on the outside edges move into the middle where you can see them. Fix them with the healing or clone tools, then offset back, and the texture tiles cleanly. It is also the quickest way to check a texture made elsewhere; if a seam appears in the middle after offsetting, it will appear on the wall or the web page too.

Repeat edge suits nudging a photo when you need a little extra canvas on one side and the edge is plain sky or wall. Transparent is useful for animation frames and sprite sheets, where you want to move the content without inventing anything.

Minimum and Maximum

Minimum and Maximum look at each pixel's neighbours and take the darkest or the brightest. On a mask or a selection channel, where white means selected, Maximum grows the white areas and Minimum shrinks them. That makes them precise tools for tightening or spreading a mask by a few pixels, for example pulling a cut-out mask in slightly so no background fringe shows around the hair.

You can choose a square or round shape for the neighbourhood. Round keeps curves round as they grow or shrink; square is a little faster to think about and keeps straight edges very straight.

On ordinary pictures, Minimum thickens dark lines and Maximum thickens light ones. That is handy for making a faint line drawing bolder before colouring.

Custom Convolution

Custom Convolution lets you define your own filter as a matrix of numbers, called a kernel. Each pixel becomes a weighted sum of its neighbours, using the numbers you type. The matrix can be from 5x5 up to 15x15, with a scale that divides the result and an offset that is added to it.

Many familiar filters are convolutions at heart. A matrix of equal numbers blurs; a strong positive centre surrounded by negatives sharpens; a matrix with positives on one side and negatives on the other picks out edges in one direction and gives an emboss. Typing these yourself is a good way to understand what blur and sharpen filters are really doing.

The scale keeps brightness under control. As a rule, set it to the sum of the numbers in the matrix, so a blur does not make the picture brighter. For edge kernels whose numbers add up to zero, use the offset to lift the result to mid-grey so negative values show.

Getting the best from these four filters

Use Offset with wrap around whenever you build textures, and do it as a final check even when you think the seams are fixed. Use Minimum and Maximum on a duplicate of a mask, and keep the amounts small; one or two pixels is often enough. Save useful convolution kernels by writing them down, or by building them into a Filter Graph preset.

Mistakes to avoid with these four filters

Offsetting a layer with transparent edges and wrap on can bring unexpected empty areas into view, so flatten texture layers first. Running Maximum on a picture with noise grows every speck, so clean up first. And with convolution, a wrong scale is the commonest cause of a white or black result.

These four filters are quiet workhorses in Paint by Zaweba, small in name but useful in many larger jobs.