Question: In Java language Colors may be produced by one of two methods For systems that produce color by the transmission of light (e.g., LCD panels,

In Java language
 In Java language Colors may be produced by one of two
methods For systems that produce color by the transmission of light (e.g.,

Colors may be produced by one of two methods For systems that produce color by the transmission of light (e.g., LCD panels, digital cameras, monitors, etc) the additive color approach is used. The additive primary colors are red (R), green (G), and blue (B). Adding R and G light makes yellow (Y). Similarly, G-B-cyan (C) and R + B = magenta (M). Combining all three additive primaries makes white, while the absence of any light results in black. This system is known as the RGB format, in which we specify the amount of red, green and blue light. If we use a scale of 0-255 for each color, then the color of an individual pixel, may be stored in 3 bytes (known as 24-bit color) and allows for 256x256x256 16 million distinct colors. For systems that produce color by the reflection of light (e.g., prints, film, etc.) the subtractive color approach is used. The picture is illuminated by white light (which contains all possible colors) and the dye or pigment removes the unwanted color, reflecting only the colors that are observed. The subtractive primaries are cyan (C), magenta (M) and yellow (Y). Theoretically, equal amounts of cyan, magenta and yellow, C+M+Y, should absorb all light producing black. In practice this is difficult to achieve so that a fourth pigment, black (K- in order not to confuse this with blue), is added. This system is known as the CMYK format. The CYMK format represents colors on a scale from 0.0 to 1.0 Ordinarily, editing of an image on a computer is done using RGB, which the computer converts to CMYK for printing. The conversion may be done as follows If the RGB values are all 0 then the CMY values are all 0 and the K value is 1 Otherwise use the following formulas: . . w= max(r / 255, g / 255,b/ 255) c=(w-(r/255))/w m=(w-(g/255))/w y=(w-(b /255))/w If the values are negative take the absolute value. Write a program that converts RGB to CMYK

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!