Update
This commit is contained in:
parent
af69eeea02
commit
87345e7f0e
24 changed files with 1859 additions and 1842 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
In [computer graphics](graphics.md) palette is a set of possible [colors](color.md) that can be displayed, the term usually refers to a selected smaller subset of all colors that can in theory be displayed (large sets of colors tend to be called [color spaces](color_space.md) rather than palettes). Nowadays mainstream computers are powerful enough to work with over 6 million 24bit [RBG](rbg.md) colors (so called True Color) practically without limitations so the use of palettes is no longer such a huge thing, but with resource-limited machines, such as [embedded](embedded.md) devices and older computers, the use of palettes is sometimes necessary or at least offers many advantages (e.g. saving a lot of memory). Nevertheless palettes find uses even in "[modern](modern.md)" graphics, e.g. in the design of image formats that save space. Palettes are also greatly important in [pixel art](pixel_art.md) as an artistic choice.
|
||||
|
||||
Palettes usually contain a few to few thousand colors and the number is normally a power of 2, i.e. we see palettes with number of colors being 8, 16, 256, 2048, etc. -- this has advantages such as efficiency (fully utilizing color indices, keeping memory aligned etc.). Palettes can be general purpose or specialized (for example some image formats such as [GIF](gif.md) create a special palette for every individual image so as to best preserve its colors). Palettes can also be explicitly stored (the palette colors are stored somewhere in the memory) or implicit (the color can somehow be derived from its index, e.g. the [565](565.md) palette).
|
||||
Palettes usually contain a few to few thousand colors and the number is normally a power of 2, i.e. we see palettes with number of colors being 8, 16, 256, 2048, etc. -- this has advantages such as efficiency (fully utilizing color indices, keeping memory aligned etc.). Palettes can be general purpose or specialized (for example some image formats such as [GIF](gif.md) create a special palette for every individual image so as to best preserve its colors). Palettes can also be explicitly stored (the palette colors are stored somewhere in the memory) or implicit (the color can somehow be derived from its index, e.g. the [565](rgb565.md) palette).
|
||||
|
||||
Palettes are related to **[screen modes](screen_mode.md)** -- systems that work with palettes will usually offer to set a specific screen mode that defines parameters such as screen [resolution](resolution.md) and number of colors we can use, i.e. the number of colors of our palette (we can normally set the colors in a palette). Modes that make use of palettes are called **indexed** because each pixel in memory is stored as an index to the palette (for example if we have a palette {red, yellow, white}, a pixel value 0 will stand for *red*, 1 for *yellow* and 2 for *white*) -- the palette serves as a color [look-up table](lut.md) (CLUT). Non-indexed modes on the other hand store the color directly (i.e. there will typically be a direct RGB value stored for each pixel). We can see that an indexed mode (i.e. choosing to use a palette) will save a lot of memory for the [framebuffer](framebuffer.md) ([VRAM](vram.md)) thanks to reducing the number of bits per [pixel](pixel.md): e.g. when using an 8 bit palette, storing each pixel (index) will take up 1 byte (8 bits, 256 colors) while in a non-indexed 24 bit RGB mode (over 6 million colors) each pixel will take 3 bytes (24 bits), i.e. three times as much. The same goes for using bigger palettes: e.g. using a 16 bit palette (65536 colors) will take four times as much memory for storing pixels than a 4 bit palette (16 colors). Note that even in indexed modes we may sometimes be able to draw pixels of arbitrary color with so called **direct** writes to the display, i.e. without the color being stored in framebuffer. With palettes we may see the use of [dithering](dithering.md) to achieve the illusion of mixing colors.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue