LodePaint User Manual
Back to main page
Filters Menu
This document describes the operations available in the Filters menu of LodePaint.
Sharpness submenu
Blur
Blurs the image by applying a convolution with a small matrix. A larger matrix gives a blurrier result. A dropdown menu allows a choice between 3 different blurs of different levels.
The affect alpha checkbox determines if the alpha channel should be blurred too. The wrapping checkbox should be used if the image is a tileable texture, it makes pixels on one side treat pixels on the opposite side as neighbor.
Gaussian Blur
Gaussian blur filter: this can blur much more than the regular blur filter. The bigger the radius, the more blur. The "wrapping" and "affect alpha" parameters do the usual. At very large radiuses, gaussian blur starts to become very slow. For even more blur, consider using the Low Pass (FFT) filter.
Sharpen
Blurs the image by applying a convolution with a small matrix.
The affect alpha checkbox determines if the alpha channel should be affected too. The wrapping checkbox should be used if the image is a tileable texture, it makes pixels on one side treat pixels on the opposite side as neighbor.
Note: on HDR images, in some cases, this filter can lead to pixels with negative values.
Unsharp Mask
This filter makes the image sharper, and to achieve that it takes a gaussian blur (which gives a blurrier instead of sharper image!) and then subtracts (with some parameters) this gaussian blur from the original image. This magically gives a result that is sharper than the original. The radius is the radius of the blur taken. Power affects how sharp the result becomes. Threshold: if this is higher, then the filter will work only on edges and less on gradients and such.
Median Filter
This filter will take the median of each pixel and its neighbors. The bigger the diameter, the more neighbors of the pixel are taken into account. This filter becomes very slow if the diameter is bigger, the diameter is capped at 9 currently and even 9 is already very slow. With a small diameter (such as 2), this filter can be used to remove some noise from an image. With bigger radiuses, the image gives somewhat the impression of having been oil painted.
Pixel Antialias
This filter can anti-alias a pixel-art drawing that has jagged edges. Jagged edges are defined here as edges that have jaggies of 1 pixel in size each. The edges are either edges of a filled shape, or thin lines. This filter makes a blur only at such edges, and in such a way that the result looks exactly the same as if the line was drawn as being anti-aliased. If the line has such an angle that each jagged part of the edge is quite long, then a gradient is done at these edges. See the images below to see better what this means.
This filter isn't perfect and may require manually retouching a few more pixels afterwards. However it can be a real time saver if you find yourself manually filling some grey pixels between black pixels to make it look anti-aliased. It can be useful to use the filter only on selected parts of the image.
This image shows the jagged version on the left and the result of the Pixel Antialias filter on the right. The bottom row shows the same images zoomed in, to see how the pixels are affected. Certain shapes that exist out of blocks larger than a single pixel are not affected at all.
Edges submenu
Edge Detect
Does edge detect on the image by applying convolution with a small matrix, this highlights edges but makes the rest of the image darker and unrecognisable. All edge detect matrices that I found on Wikipedia are included. It's also possible to rotate each matrix in steps of 45 degrees. This rotation has an effect on the result: the direction in which edges are detected. So in total by using rotation and matrix type combinations, this filter supports 40 predefined matrices.
The affect alpha checkbox determines if the alpha channel should be affected too. The wrapping checkbox should be used if the image is a tileable texture, it makes pixels on one side treat pixels on the opposite side as neighbor.
Emboss
Applies the "emboss" effect on the image by applying convolution with a small matrix and adding grey to the color. There are 3 matrices to choose from and, similar to edge detect, each matrix can be rotated in steps of 45 degrees. This has a result on the direction from which the "light" appears to come on the embossed image.
The affect alpha checkbox determines if the alpha channel should be affected too. The wrapping checkbox should be used if the image is a tileable texture, it makes pixels on one side treat pixels on the opposite side as neighbor.
Alpha submenu
All filters in this submenu generate an alpha channel for the image based in the RGB color of each pixel, or affect the alpha channel in some other way.
Opaque
Make the image opaque, removes the alpha channel.
Apply Alpha To BG
This blends the image on the BG color using the alpha channel. The image becomes opaque after this, and you "see" the BG color through what used to be the translucent pixels.
Keep Only Alpha
Sets the RGB value of all pixels of the image to the BG color. The alpha channel remains the same.
Negate Alpha
Similar to negate RGB, but works on the alpha channel instead of the R, G and B channels. Transparent pixels become opaque, opaque pixels become transparent, and translucent pixels become the opposite translucent. This filter is powerful in combinations with other filters of the Alpha menu, because for example the "Translucent" filter makes dark pixels transparent and bright pixels opaque, but doing negate after that inverts this.
Translucent
Makes darker pixels more translucent, brighter pixels less translucent.
Modulated
Makes grey pixels more translucent, bright and dark pixels less translucent.
Saturation
Makes pixels which are less saturated more translucent, colorful pixels less translucent.
Key
Makes pixels which exactly match the foreground color, translucent, all other pixels opaque (unless they already were translucent).
Soft Key
Makes pixels which exactly match the foreground color, translucent. Pixels that match the foreground color less, will become less translucent.
Extract Clouds
This filter uses both the foreground color and background color. Pixels that have the FG color will become opaque, pixels that have the BG color will become transparent, and pixels in between will become translucent.
This filter can for example be used to extract white clouds from a blue background: set the FG color to white, the BG color to blue (use color picker on the imag). The apply "Extract Cloud". And now you can easily turn them for example into green clounds on a red sky: first set BG color to green, and use "keep only alpha". Then set BG color to red, and use "apply alpha to bg".
In more detail, this filter does the following to the color:
In the 3D RGB color space, a normal vector is defined between the foreground and background color, creating a plane through the BG color. Colors on this plane and on the side of this plane away from the FG color, will all become fully translucent. On the other side of the plane, pixels with a color that have a distance to the plane that is equal to the distance between FG and BG color, will all become fully opaque. Colors with a shorter distance become gradually more translucent (until being fully transparent when the distance is zero). Colors further away from the plane, become fully opaque too.
The Key, Soft Key and Extract Cloud filters are grouped together in the menu because there's a sort of hierarchy: Key makes one exact color transparent, Soft Key gradually sets translucency based on a single color, Extract Cloud gradually sets translucency based on two colors.
Alpha To Grey
Sets the RGB value of each pixel to a greyscale color that matches the alpha channel. The alpha channel is set to opaque.
Generate submenu
This submenu contains filters that generate something.
Each of those filters has a "Opacity" checkbox in their settings. This does the same for each of those effects: if Opacity is less than 1.0, then the generated image is blended on top of the already existing image data.
Grid
Generates a simple line grid.
Tiles
Generates a tile pattern where tiles switch between the foreground and the background color.
Random noise
Adds noise to the image.
Include alpha: also add noise to the alpha channel.
Colored: if true, the noise is independent in R, G and B channel. If false, the noise is grey and the same in R, G and B channel.
Opacity: Whether or not to see the original image through the noise, and how much.
Salt and Pepper: the more this slider is to the right, the less pixels will have noise on them, so that the noise is "salt and pepper" noise.
Clouds
This generates clouds with an effect similar to perlin noise.
Include alpha: also generate clouds in the alpha channel
Colored: if true, the clouds use BG and FG color, if false they use black and white.
Size: affects how big or small the patterns in the clouds are.
Interpolation: quality of the interpolation algorithm. Bicubic is best, Bilinear is OK, Nearest is ugly and only included for completeness.
Marble
This filter also uses something similar to perlin noise. Unlike clouds, the random values aren't used to affect pixels directly, but to affect a shiftT in a certain 2D cosine or sine function. This sine function can have the shape of stripes, rings or dots. The first parameters in the filter dialog are the same as those in the clouds filter, but need to be interpreted as working on a shape rather than on pixel color values. Again, setting "Interpolation" to Nearest is not a good idea due to the uglyness, that option is only included for completeness. The extra parameters are:
Sine pattern: the shape of the 2D sine function (stripes, rings or dots. To see the dots, set Power lower)
Power: how much effect the randomness has. This setting has an effect similar to the Size slider.
Period X and Period Y: determine the angle and size of the stripes in case of stripes, the size of the rings in case of rings, the X and Y size of the dots in case of dots.
The marble filter can not only be used for marble, but also for wood, certain animal hides or other natural patterns, just experiment a bit with the settings.
Pixel Shadow
This tool can generate shadow in pixel-drawings. This tool is only useful in drawings with a plain background color, and no anti-aliasing. It uses the currently active foreground and background color. It sees the background color as the area to project a shadow on, the foreground color is the color used as shadow, and all other colors on the image will generate shadow on pixels that exactly match the background color.
Effects submenu
Scan Lines
This generates simple horizontal scanlines on the image, to make it seem a bit as if it's on a TV screen.
Mosaic
This makes the image blocky. It's as if it'll exist out of big pixels. If antialias is enabled, then each block will be the average of all pixels that were in that location. If false, the complete block gets the color of the top left pixel and the information of all other pixels is discarded.
Bits submenu
The filters in this submenu operate on the bits of the color channels of the image. This works only on 32-bit RGBA images (the default type of image), not on 128-bit floating point images, because the operations on bits are integer operations.
The R, G, B and A channel are each an 8-bit integer number, e.g. binary 01001111. The bit operations work by moving the order of these bits around in some way.
Mirror Bits
This literally mirrors the bits of each color channel, e.g. 01001111 becomes 11110010. The effect of this operation is:
Photos will become something that looks like random noise, but it is not random at all! Doing the operation again brings back the original image.
Non-antialiased line art images with lots of plain colors and no gradients, will still be very recognisable, the colors are just different.
When done on images with some very subtle color changes, e.g. images where accidently some color channel was set to value 254 instead of 255, these subtle changes will become very noticable, because the closer colors are together, the more different they'll look after this opration.
This operation is completely invertible without any information loss, mirroring the bits a second time brings back the original image.
Shift Bits 1
This shifts the bits one position to the left, and the leftmost one goes to the right. e.g. 01001111 becomes 10100111. The effects of this operation are quite similar to Mirror Bits. This operation isn't invertible in the same way as mirror bits though. Instead, repeating this operation 8 times brings back the original image, also without information loss.
Shift Bits 4
This does the same as Shift Bits 1, but it shifts the bits 4 steps at once. This operation is invertible, since repeating it a second time shifts the bits back to the original position.
DSP submenu
This submenu contains only filters related to the Fourier Transform.
FFT (real) and IFFT(real)
Takes the fast fourier transform, and inverse fast fourier transform, of the iamge. The spectrum is made so that it has only real values but still contains all information needed to reproduce the original image, so this is a bit different than a true FFT on complex numbers.
These filters are both the inverse of each other. If you do FFT first, then IFFT again, an image close to the original is the result. However it will be of lower quality due to information loss, unless the color depth is 128-bit floating point color, then there is almost no information loss thanks to the high precision.
- General explanation of FFT
FFT takes the discrete fourier transform (with "FFT" algorithm, but it also supports non-power of two images) of the image. IFFT inverts it.
This brings the image from temporal domain to frequency domain, and vica versa.
The frequency domain shows the image in an alternate way, all the "high frequencies" of the image
will be on the sides, while all "low frequencies" are in the center.
- Limitation in this painting program:
Normally, when doing FFT on an image, then doing IFFT again, the exact same original image should appear. This is the case if you convert your image to 128-bit floating point color, but not if you use 32-bit RGBA color because with only 256 possible discrete values per channel in each pixel, information about the FFT spectrum gets lost.
- Explanation of FFT result
After doing FFT on your image, the result is usually a greyish image with more colors in the center than on
the sides (NOTE: when working with floating point color the result isn't greyish but black, and many pixels have negative values that show as black on screen). Grey values represent zero-values in the frequency domain. Darker values are negative, higher
values are positive. Two quarters of the resulting image contain imaginary pixels, the other two quarters
contain real pixels. They're all displayed as real though. The colors in the center are the low frequencies
of the image, that is, the general overall color of it and very blurry shapes. The pixels more towards the
sides, contain high frequencies of the image, such as sharp edges, etc... The pixel in the exact center
is the DC component (containing the average color of the complete image), and to retain information this
is the only pixel that hasn't got the grey color added to it. If you touch this pixel and then do IFFT,
the overall color of the result will not be like the original anymore (e.g. if you make this one pixel
green, after IFFT the whole image will be greenish).
NOTE: the operation may take a long time on images larger than 512x512 pixels. Sorry for that!
NOTE: if the complete image becomes transparent after operations and you don't want to affect alpha, disable the "affect alpha" option in the global filter settings
By experimenting with FFT and IFFT, you can find ways to generate patterns that might be useful for texture generation, even if those patterns have nothing to do with the original image they were generated from anymore.
FFT (magnitude)
This displays the FFT of the image in a way many handbooks about Fourier Transform show them: it keeps the magnitude of the complex-numbered pixels, and discards the phase.
Low Pass Filter (FFT), High Pass Filter (FFT), Band Pass Filter (FFT), Band Stop Filter (FFT)
These all do the following to the image:
-Take the FFT (and keep the numbers in high precision floating point while there, even if the image was in 32-bit RGBA color)
-Do something to the spectrum (e.g. removing high frequencies for low-pass, removing low frequencies for high-pass, etc...)
-Take the IFFT of the modified spectrum to get back a modified version of the original image. In case of 32-bit RGBA, the pixels are discreticised again, in case of floating point color they stay high precision (this might currently not be supported yet).
These filters work like their definition in signal processing.
On audio, a low pass filter keeps bass, a high pass filter keeps high tones, a band pass filter keeps tones of a certain frequency and a band stop filter removes tones of a certain frequency.
On images, this is similar:
-a low pass filter keeps only blurry parts of the image
-a high pass filter keeps only sharp parts of the image
-a band pass filter keeps only some frequency of the image
-a band stop filter removes a certain frequency of the image
Explanation of the settings:
-radius: frequencies below or above this radius are kept. For the "band" filters, two radii are given and the values between or outside these are kept.
-"grey instead of DC": for filters that remove the DC component of the frequencies: either keep the DC anyway, or add grey (128, 128, 128) to the image to compensate negative color values.
-stop factor: the multiplication factor to destroy the stopped frequencies. 0 blocks them completely, higher values keep them anyway (1 keeps the completely)
-pass factor: the multiplication factor applied to the frequencies that are left through. 0 destroys them (this defeats the purpose of the name of the filter), 0.5 etc partially keeps them, 1 doesn't affect them, higher than 1 makes them shine.
Usage of these filters:
-Low pass filter:
--Usage 1: Blurring. set "low factor" to 0 and "high factor" to 1 to blur the image. Lower radius means more blur. Note that this in the Gaussian Blur filter, higher radius means more blur, while in the low pass filter it's the opposite (because here it represents the radius of the part that is not removed from the spectrum).
--Usage 2: "Shining". Set "low factor" to 1 and "high factor" to e.g. 2, 3 or 4. Set radius to for example 7. It's as if all low frequencies emit light.
-High pass filter:
--Usage 1: Set "low factor" to 0, "high factor" to 1 and "grey instead of DC" checked to have behaviour similar to the High Pass filter in most other painting programs. Higher radius gives more effect. NOTE: this filter is actually NOT the same as the high pass filter in most painting programs, and such a non-FFT high pass filter is planned for LodePaint later.
--Usage 2: Sharpening and adding more contrast. Set radius to 2, "low factor" to 1, "high factor" to 2, 3 or 4 and uncheck "grey instead of DC". Higher radius gives blurry artefacts.
-Band pass and band stop filters:
--Usage 1: Scientific purposes or to experiment with things from your Digital Signal Processing class
--Usage 2: create "water waves" on the image. Use band pass. Set low radius to 19, high radius to 20. Set "low factor" to 1, "high factor" to 2, 3 or 4. Watery waves (of the frequency between 19 and 20) appear on top of the image.
--Usage 3: "Shining 2": Use band stop filter. Set "low factor" to 1, "high factor" to 2, 3 or 4, low radius to 10, high radius to 20. Experiment with the radiuses.
--Usage 4: "Bleaching" your image (many combinations of parameters can result in that effect)
NOTE: due to the way the algorithms work, these filters always have "wrapping" behaviour, even for non-tiling images, so things from the left side will leak through the right side and so on
User Defined
This applies a 7x7 convolution matrix, which the user can enter, to the image. A multiplier, divisor and extra sum can be added to the pixels.
Legal Stuff
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Copyright (c) 2009-2010 by Lode Vandevenne.
Note: No images? Get the full manual at http://sourceforge.net/projects/lodepaint/files/LodePaint_Manual_Full.zip/download/. The full manual with images is released separately because the images filesize is larger than that of the program!