Graphics Examples / Indexed Images

Indexed images are made of two parts, pixel data and color model data (also called gradient or palette). Each pixel gets its color equivalent (what we see) by asking the color model for the color corresponding to the pixel’s index. Use the Gradient Editor to modify color model data.

Example 1, a byte image with pixel values varying from 0 to 255 left to right and a color model varying from 0 to 255 (a grayscale gradient) left to right :

Example 2, the same pixel data as example 1, but now with a black to green gradient :

Example 3, the same pixel data as example 1, but now with a colorfull gradient :


Example 4, if the color model has less than 256 values the higher pixel values will appear transparent because they will not have a color to map to, start with a byte image :

Open the Gradient Editor and select the "fire" gradient, then click Gradient -> Invert Table :

To make the sky transparent, select the orange, red and white values with the mouse then click Gradient -> Crop :

To then fill the sky black, click Edit -> Load From Image. Select the transparent values with the mouse, then click Gradient -> Remap and choose black for the first and last entries :


Editing pixel data is a very different thing and will cause new colors to be mapped to the edited pixels. This property can be used to create interesting blends :

Example 5, a short series transitioning from a vertical ripple to a horizontal ripple by editing pixel data only. All have the same color model as example 3 :


More tutorials


Home (web) Screenshots (web) Register (web) Cylekx GraphicsModule