With a bigger list, you would need at least two bytes and so would only get a 33% reduction in size, likely not worth the added complexity. Colors in the list are described by the usual three bytes, and pixels are described by a single number which is the index of their color in the list.įor instance you can have a colormap with just 8 colors such as this:Īnd the yellow pixels in the image will be designated with the value 4.Ī (small, 6×4 pixels ) French flag would for instance be represented by:Ĭolormaps are usually limited to 256 colors, because this allows the index to fit in a byte, so this makes the image use one third of the bytes needed for a full-color equivalent. In such images, the (limited) set of colors is kept in a list, called the colormap. However, this can be quite wasteful if there are few colors. A byte can hold 256 values, so the total number of possible colors (R, G, and B combinations) is 256×256×256=16777216 (≈16.8 million). These values are usually kept in 8-bit bytes(*). In most image formats, each pixel is described with three separate values for red, green, and blue.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |