![]() This is why RGB values represent color in computer programs. When combining light (such as the light given off by your computer screen), red, green, and blue light can be combined to form any other color. However, the physics of light uses what’s called an additive color model. This is why color printers have CMYK ink cartridges: the Cyan (blue), Magenta (red), Yellow, and blacK ink can be mixed together to form any color. This is known as the subtractive color model, and it applies to dyes, inks, and pigments. In grade school you learned that mixing red, yellow, and blue paints can form other colors for example, you can mix blue and yellow to make green paint. Table 17-1 lists a selection of standard color names and their values. Pillow uses the standard color names that HTML uses. After all, invisible red looks the same as invisible black. If a color has an alpha value of 0, it is invisible, and it doesn’t really matter what the RGB values are. White, the combination of all colors, is (255, 255, 255, 255), while black, which has no color at all, is (0, 0, 0, 255). This color has the maximum amount of red, no green or blue, and the maximum alpha value, meaning it is fully opaque. For example, the color red is represented by (255, 0, 0, 255). In Pillow, RGBA values are represented by a tuple of four integer values. If an image is displayed on the screen over a background image or desktop wallpaper, the alpha value determines how much of the background you can “see through” the image’s pixel. Images also have an alpha value to create RGBA values. A pixel’s RGB setting tells it precisely what shade of color it should display. ![]() These RGBA values are assigned to individual pixels a pixel is the smallest dot of a single color the computer screen can show (as you can imagine, there are millions of pixels on a screen). Each of these component values is an integer from 0 (none at all) to 255 (the maximum). An RGBA value is a group of numbers that specify the amount of red, green, blue, and alpha (or transparency) in a color. Computer programs often represent a color in an image as an RGBA value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |