Filter Factory Workshop
Top Design with Filter FactoryCreate linear gradients

Create linear gradients

"Filter Factory programming" is defining arithmetic expressions that determine the value for each channel of a pixel. Then, Filter Factory applys the same expressions sequentially to all pixels in the image selected. So, if we want not only a simple fill with a single color but variety, we should put some variables in our expressions. "Variable" means the number that varies with the pixels automatically, for instance, a number that shows the place of a pixel, such as x or y. At the first, create new canvas (256 pixels square), layers aren't neccesary now.

Horizontal gradient

Variable x (lower case) shows the horizontal place of a pixel. So if we put x into text fields of FF, the pixel value varies as pixel comes to the right, and a gradient appeares on the image window! However, gradients made of only x depends on image size. If the image width is less than 256, the result will be too dark, and if the width is greater than 256, it will be too bright, because a complete gradient in 8 bit image takes integer values from 0 to 255.



Width, the maximum value of x, actually varies with images, but the variable X (upper case) represent the value, and we can convert it into the range from 0 to 255, with the function scl().

Put this expression into each fields of Filter Factory and apply this expression to any selections, we can always get full ranged gradients.

Vertical gradient

Now we can create vertical gradients with a slight modification.


top of this page