In the graphic art field, there is often a need to change the color of a raster image or graphic that was created and stored on a computer. This need to make color changes can occur for a variety of types of images—whether they are ultimately intended to be displayed on a computer display or monitor, paper, apparel or some other medium—including clip art, computer illustrations, photography, transfer graphics for apparel, and many other such images. For example, it is common for Internet websites offering products for sale, such as automobiles and apparel for example, to allow a user to change the color of a selected product in real time in order to view the same product in different colors. Another example occurs in the field of graphic art used for transfers to apparel, wherein it may be desirable to easily produce the same graphic in different colors. Additionally, users may desire to have flexibility to modify the color of various portions of a given image or graphic. An example of this may be an image of a cowboy where his hat, shirt, kerchief, pants and boots are all different colors from each other. A designer may wish to change the cowboy's shirt color from blue to yellow, while leaving the rest of the image intact.
One known method for changing the color of all or part of an existing image or graphic is known as the “Hue Shift” method. When the Hue Shift method is used, the designer originally colors the various portions of the image (during the design process) using the HSB (Hue, Saturation, Brightness) color model, wherein the “hue,” “saturation,” and “brightness” are three “channels” used to define the color and appearance of each pixel in an image. Each pixel is defined by a value for each of the three HSB channels. This method is well known to those skilled in the art. According to this method, the designer colors a portion of an image having a particular color using a single hue value. For example, building on the example of the cowboy image mentioned above, if the cowboy's shirt in the original design is blue, then the designer would color the cowboy's shirt using a single hue value corresponding to blue for each of the pixels in the shirt. Then, the designer would create various shades and highlights in the cowboy's blue shirt by adjusting the saturation and brightness channels of each pixel of the shirt. The combination of the blue hue and the values applied in the saturation and brightness channels in each of the pixels gives the cowboy's shirt its overall appearance, including color and highlights and shading.
After the image is designed with an original set of colors for each particular region of the image, the colors can be changed by simply changing the value of the hue channel. For example, the hue channel could be changed from a blue value to a yellow value. The values of the saturation and brightness channels would remain the same, which conceptually should maintain the same highlighting and shading in the image. However, this approach has several shortcomings. First, values in the saturation and brightness channels affect the appearance differently depending on the value in the hue channel. For example, in the HSB color model, darker shades of a particular color are created by reducing the value of the brightness channel, which essentially introduces a certain amount of black into the color. While this approach is effective for darker colors, it tends to make lighter colors look dingy or “muddy.” On the other hand, lighter shades of a particular color are created by increasing the value of the brightness channel, which introduces white into the color. This approach is effective for lighter colors, but tends to make darker colors look flat or “milky.” Another shortcoming of the Hue Shift method is that is can only be used in connection with images created using the HSB color model, whereas the CMYK (Cyan, Yellow, Magenta, Black) color model is commonly used in various applications, such as printing. Finally, the HSB model requires that images be colored with starting color values during the design process. The values chosen by the designer for a particular color will depend on the intended color management/printing workflow variables, such as color profiles, printer selection, ink selection and media selection. If any of these variables change in the future, the original HSB design will look different unless the HSB values are manually adjusted in the image file, which effectively requires that the image be re-created by a designer.
Another method for changing the color of an image/graphic is the “Swap Image” method, wherein a designer creates several versions of the same graphic or image, each with different colors. Then, when a user wants to change the color of the all or part of the graphic/image, the original image/graphic is simply swapped out for a different pre-colored image/graphic having the same design but different colors. Essentially, the designer must create a different version of the same image/graphic for each color option that is made available to a user. As a result, this method is very time consuming and overhead intensive. Therefore, though this method enables better color reproduction for the various options available to a user, the color options are more likely to be restricted because of the substantial work required to produce a separate and distinct graphic/image for each color option.
The inventor hereof has developed an improved system and method for changing the color of an image/graphic created and stored on a computer.
A method for coloring a greyscale raster image is disclosed. The greyscale raster image is defined by a plurality of predefined greyscale values. The method of coloring the greyscale raster image includes the steps of: (i) receiving a color selection intended for a portion of the raster image; (ii) retrieving from a predefined database multiple groups of predefined color parameter values, each group of predefined color parameter values defining a color parameter associated with the selected color, and each group of predefined color parameter values including a predefined greyscale value; and (iii) for each pixel within said portion of said raster image, determining a pixel channel value for each of a plurality of color channels that collectively define an appearance of said pixel, said determination being based on said predefined greyscale value for said pixel, and said predefined color parameter values for at least two of said predefined color parameters associated with said selected color.
The drawings described herein are for illustrative purposes only of selected embodiments and not all possible implementations, and are not intended to limit the scope of the present disclosure.
Corresponding reference numerals indicate corresponding parts throughout the several views of the drawings.
A system and method is described for changing the color of at least a portion of raster image. The system and method starts with a greyscale CMYK (Cyan, Magenta, Yellow, Black) format raster image originally created by a designer as a “base” image. The greyscale base image may be colored in real time by calculating CMYK values for each pixel in the image or selected portion of the image based on (i) the desired color chosen by a user; (ii) CMYK values for multiple color parameters retrieved from a database corresponding to the desired color; and (iii) the K value—the degree of grey—of the pixel in the base image. The CMYK values for the pixel are calculated by interpolation between the predefined CMYK values (stored in the database) for two of the color parameters. The color parameters may be the Lightest Tone, the Mid Tone and the Darkest Tone for a particular color.
The embodiments described herein involve coloring computer images known as “raster images.” A raster image—also known as a bitmap—is an image formed by a collection of pixels, or points of color, which are normally arranged in a rectangular format.
In a raster image, the color of each pixel is defined by various values according to a standard color format. The CMYK (Cyan, Magenta, Yellow, Black) format is a commonly-used format for defining the color of each pixel of a raster image. Under the CMYK format, the color of each pixel is defined by a blend of different amounts of cyan, magenta, yellow and black, each of which is referred to as a “channel.” Thus, each pixel 230 is defined by four values—one for each of the C, M, Y, and K channels—each of which being between 0 and 100 and defining how much of the respective C, M, Y and K components to blend into the color for that particular pixel 230 to achieve the precise desired color.
The disclosed system and method starts with a base raster image that is created by an artist/designer in a greyscale CMYK (Cyan, Magenta, Yellow, Black) format. The greyscale CMYK base image usages only the K (black) channel. That is, the C, M and Y channels of each pixel of the base image are set to zero and each pixel is defined only by a K value, which essentially represents the amount of black that is in the pixel. As a result, the base image created by the designer is a “black and white” image, where each pixel is either all black (K=100), all white (K=0) or a shade of grey (100>K>0). The various levels of grey are used to create shading and highlighting in the image. After the base greyscale image has been created, it can be colorized in real time based on user selections for color. The image can be colorized by the designer or it can be colorized by a user of a computer program, such as in connection with the Website, to colorize the image in real time. The steps associated with coloring the greyscale raster image are executed by at least one computing device having non-transitory computer-readable storage medium with an executable program stored thereon to execute the steps, as described hereinbelow.
The coloration of the base image is accomplished by first receiving a chosen color for all or a portion of the image. For example, again building on the cowboy image example described above, a user may desire to color the cowboy's kerchief “red.” In this case, the pixels in the image that define the cowboy's kerchief will need to be colored “red,” but each pixel is likely to have a slightly different shade of red due to the highlighting and shadowing in the base image. Therefore, a value (e.g., between 0 and 100) must be calculated for each of the Cyan, Yellow, Magenta and Black channels for each pixel of the cowboy's kerchief. Those values are calculated by using the K-channel value of the base image to index into a database—referred to herein as a “color engine database”—and to interpolate values for each of the CMYK channels for each pixel based on the predefined CMYK values of at least two color parameters for each color. In one embodiment, the color engine database includes three color parameters for each color, namely a “Lightest Tone,” a “Mid Tone,” and a “Darkest Tone.” Collectively, the Lightest Tone, Mid Tone and Darkest Tone are referred to herein as the “color parameters.” Different numbers of color parameters may be employed as well. The color engine database stores predefined values (i.e., “color parameter values”) for the CMYK channels for the Lightest Tone, Middle Tone and Darkest Tone of each available color.
Each of the Lightest Tone, Mid Tone and Darkest Tone are associated with CMYK values, one value (ranging from 0 to 100) for each of the CMYK channels. Accordingly, in the illustrated embodiment having three color parameters, each color in the color engine database is associated with 12 values (e.g., between 0 and 100), i.e., four for each CMYK parameter. For example, “Color #1” in
The CMYK values for each pixel in the image (referred to individually as a “calculated pixel”) are calculated as follows. The color chosen by the user is located in the database. Then, the K value of the calculated pixel of the base image is assessed to determine if it corresponds to the Lightest Tone, the Mid Tone or the Darkest Tone. In the embodiment where the K values of the base image can range from 0 to 100, this is accomplished by determining if the K value of the calculated pixel of the base image is 0 (corresponding to the Lightest Tone), 50 (corresponding to the Mid Tone) or 100 (corresponding to the Darkest Tone). If the K value of the calculated pixel of the base image corresponds to one of the Lightest Tone, the Mid Tone or the Darkest Tone, then the CMYK values from the color engine database corresponding to the Lightest Tone, the Mid Tone or the Darkest Tone, as applicable, are assigned to the calculated pixel. For example, with reference to
If, as in most cases, the K value of the calculated pixel of the base image does not exactly equal 0 (Lightest Tone), 50 (Mid Tone) or 100 (Darkest Tone), then the proper CMYK values for the calculated pixel are calculated by interpolation between the closest two color parameters, e.g., between the Lightest Tone and the Mid Tone or between the Mid Tone and the Darkest Tone. For example, again referring to
In one embodiment, with reference the example of
The system and method described above has various benefits. For example, the method described above allows a designer to independently specify CMYK values for the color parameters, such as Lightest Tone, Mid Tone, and Darkest Tone, which allows the designer better flexibility to create consistent shading and highlighting patterns, regardless of the selected color. Further, because the color engine database is separate from the image itself, the designer need only create the base image once. Yet, the color engine database can be easily updated and revised without the need to modify the base image. Further, different color engine databases can be selectively used with the same base image, which may sometimes be important due to the fact that there are variations in the way different printers print images on different types of media. The ability to match different color engine databases with different printers allows a designer to ensure consistent appearance of the image, regardless of the selected color(s) and regardless of the selected printer. Finally, the method described herein can be used with known graphic design features, such as the use of multiple layers within the same design and the use of transparent image layers of 256 different degrees of transparency.
The foregoing description of the embodiments has been provided for purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure. Individual elements or features of a particular embodiment are generally not limited to that particular embodiment, but, where applicable, are interchangeable and can be used in a selected embodiment, even if not specifically shown or described. The same may also be varied in many ways. Such variations are not to be regarded as a departure from the disclosure, and all such modifications are intended to be included within the scope of the disclosure.