Color depth is one of the most characteristic of the color stored in the computer. If color space specifies how to construct color from its components, color depth specifies how these components are stored in the computer memory. Usually color depth is measured in the number of bits used to represent one color value (pixel) - bits per pixel (bpp). The more bits a pixel occupies, the more different colors can be represented by this pixel. For example, 1-bit pixels can represent only 2 colors, 8-bit pixels - 256 color, 24-bit pixels - 16 777 216 colors (the so-called true color; researches prove that the human eyes cannot recognize more colors). On the other hand, the big color depth means that image requires more memory. Sometimes true color is not required (for example for storing documents or imagery which contains only a few colors), that's why we can greatly save memory by reducing the color depth.
Graphics Mill for .NET supports images with the following color depths:
As you can notice here, colors differ not only in the number of bits per pixel, but also in the method of storage: index in the palette (i.e. indexed bitmaps) or direct color value.
Indexed images always contain a palette - a special table of colors. Each pixel is an index in this table. Usually a palette contains 256 or less entries. That's why maximum depth of indexed pixel is 8 bpp. Using palettes is a common practice when working with small color depths.
Unlike indexed images, pixels of non-indexed continuous images store actual color values instead of palette index. Each pixel consists of components (also known as channels). Channels can be interpreted differently, according to the color space of the pixel. For example, grayscale images have only one luminosity channel. RGB images have three channels - red, green, and blue. CMYK images have four channels - cyan, magenta, yellow, and black. Besides, pixels can contain extra component called alpha channel. Alpha channel does not contain any color or luminosity information, it specifies the degree of pixel opacity when it is overlayed on another image. The less alpha value is, the more transparent is the pixel.
Let's examine possible color depths of Graphics Mill for .NET in more details.
1-bit images (also known as bitonal) can consist only of two colors. Usually these colors are black and white (however as it has a palette, you can specify any other two colors). The main benefit of bitonal images is an extremely compact size, however usually two colors are not enough. But nevertheless, there is a kind of images, where 1-bit color depth is widely used: documents, paperwork, faxes, and similar images.
In Graphics Mill for .NET such images have a Format1bppIndexed pixel format. Graphics Mill for .NET allows some basic transformations on such images (resize, flip, rotate, crop). When zooming a bitonal image, you can use special technique of resizing which preserves details and produces high quality (known as scale-to-gray).
Maximum count of 4-bit colors is 16, maximum count of 8-bit colors is 256. These color depths are used when it is necessary to store an image with small amount of colors. The typical example is web imagery - buttons, banners, logos, etc. Relatively small size makes such images ideal for web.
In Graphics Mill for .NET such images have pixel formats Format4bppIndexed and FormatbbppIndexed accordingly. For these formats Graphics Mill for .NET supports only several basic transforms and effects (rotate, resize, crop and some others).
These pixel format are not wide-spread nowadays, but some file formats allow to store them. Graphics Mill for .NET cannot work with pixels in this format directly, however it can load and convert them to any other pixel format.
In Graphics Mill for .NET these formats are represented by: Format16bppArgb1555, Format16bppRgb555 and Format16bppRgb565.
These images are most popular in store photos and similar images. This color depth allows to represent as many color hues as the human eye can recognize. There are the following kinds of 8-bit per channel pixel formats supported in Graphics Mill for .NET:
It may seem strange, why we need more than 8 bit per channel if our eye will not notice the difference. The problem is when we apply some operations to the 8 bit per channel image (for example tone adjustment or color enhancement), some color information can be lost or distorted due roundoff errors. It is especially noticeable when we apply these operation several times. To avoid this problem, we have to increase the color depth. That's why most scanners produces 48 bpp images instead of 24 bpp. There are the following 16 bits per channel pixel formats are supported in Graphics Mill for .NET: