# Patent

## Title
Color transform method for preferential gamut mapping of colors in images

## Abstract

A method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut includes the steps of: transforming the color values of the first color space to color values in an intermediate color space; specifying one or more predefined color regions in an intermediate color space; preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color values to fit the second color gamut while restricting the mapping to regions outside of the predefined color regions to produce enhanced modified color values in the intermediate color space; and transforming the modified color values to code values for driving the output device.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This is a Continuation-in-Part of U.S. application Ser. No. 09/540,807 filed Mar. 31, 2000 by Woolfe et al.


FIELD OF THE INVENTION
This invention relates to the field of digital image processing, and in particular to the field of color image transformation for preferential color gamut mapping.
BACKGROUND OF THE INVENTION
In designing color image capture and reproduction systems, it is important to be able to render colors in an optimal manner such that they are most meaningful, appropriate, natural, and pleasing. Various modes of color reproduction are applicable in different color reproduction applications. For instance, a color image in a fine art publication may well be judged in terms of the accuracy of color appearance of the reproduction relative to the original artwork. Images intended for advertising may be judged in terms of the calorimetric accuracy of the reproduction of certain trademark colors against an aim. Color reproductions of analytical test charts such as the MacbethTM color checker are judged relative to the spectral accuracy of the reproduction patches compared to the objects those patches represent. Pictorial images are generally judged against more arbitrary standards. Images used in commercial applications are often rendered more colorful, making them more appealing and attention grabbing. Professional portrait photographers will always print skin tones that please the subject rather than provide the most accurate rendition. Personal photographs, or snapshots, are frequently judged relative to a memory of how the original scene appeared. These memories are seldom colorimetrically accurate and are frequently influenced by color preferences of the customer, particularly for the so-called memory colors including sky, foliage and skin tones.
A comprehensive discussion of color rendition can be found in R. W. G. Hunt, The Reproduction of Colour, 5th Edition, Fountain Press, pp. 223-242 (1995). Hunt describes how color images can be reproduced in a range of different ways, to achieve a number of different objectives. In each case, however, observers judge the color quality of that reproduction according to their intended use of the image. Hunt has identified six distinct modes of color reproduction that cover all applications of color reproduction from entertainment to scientific:
1. The most demanding mode of color reproduction is “spectral reproduction”. This is where the spectral reflectance (or transmittance) of the reproduction matches that of the original. In this case the reproduction and the original will match in appearance regardless of changes in illuminant for any observer. Spectral color reproduction is seldom achieved in practice and is not commercially viable as a means of image reproduction.
2. In “colorimetric color reproduction” the chromaticities and relative luminances of the original and reproduction match for a defined viewing illuminant and a defined standard observer. Since color appearance is not independent of viewing illuminant intensity, calorimetric reproductions do not match originals in color appearance for large intensity changes.
3. “Exact color reproduction” occurs when the conditions for calorimetric color reproduction are met and, the absolute luminances of the reproduction and original match. The original and reproduction will match in appearance for a standard observer under identical conditions of visual system adaptation.
4. If a reproduction is to be viewed under different conditions of adaptation than the original then a color appearance match can only be achieved if adaptation factors are considered and accounted for in the mode of reproduction. This is the case with “equivalent color reproduction”. This is very difficult to achieve in practice because the colorfulness of objects seen under bright daylight usually cannot be reproduced under artificial illuminant viewing conditions.
5. In “corresponding color reproduction” the objective is to reproduce an original scene as it would appear if it were viewed under the reproduction viewing conditions.
6. The final mode of color reproduction is “preferred color reproduction”. In this mode the reproduction colors are rendered to match the preference of the observer. These preferences will tend to vary from observer to observer but there are general, quantifiable preferences that exist across most observers that can be included in a color reproduction.
In addition to the Hunt book, there are a number of publications in the technical literature that refer to the importance of preferred colors and concept of key memory colors in the art of rendering natural images. For example, C. J. Bartleson, “Memory Colors of Familiar Objects,” Journal of the Optical Society of America, 50, pp. 73-77, (1960); Siple et al., “Memory and Preference for the Colors of Objects,” Perception and Psychophysics, 34, pp. 363-370, (1983); S. Sanders, “Color Preferences for Natural Objects,” Illuminating Engineering, 54, p. 452, (1959); and Hunt et al., “The Preferred Reproduction of Blue Sky, Green Grass and Caucasian Skin in Colour Photography,” Journal of Photographic Science,” 22, pp. 144-150, (1974). It is evident from this literature that, for some objects whose colors are well-known, preferred color reproduction may be advantageous, wherein departures from equality of appearance (whether at equal or at different absolute luminance levels) may be required in order to achieve a more pleasing rendition.
As a consequence, imaging and photographic companies have intuitively understood the benefits of preferred color rendition for many years and have attempted to achieve some measure of customer preference through careful manipulation of the characteristics, including tone scale, interimage and spectral sensitivity, of the photographic system. In contemporary imaging systems, preferred color rendering is often accomplished through the use of some form of preferred color mapping. For example, U.S. Pat. No. 5,583,666 issued Dec. 10, 1996 to Ellson et al., describes a method for transforming an input color space to an output color space using a transform. In particular, a computer graphics morphing technique is described wherein the explicit constraints are comprised of points residing on the gamut boundary of the input and output color spaces. Although this method produces a smooth output rendition, it is limited in terms of the constraints it can impose on the color space transformation. An arbitrary point in the color space cannot be moved to another arbitrary position in color space. A group of patents issued to Buhr et al. (U.S. Pat. Nos. 5,528,330; 5,447,811; 5,390,036; and 5,300,381) describe color image reproduction of scenes with preferential tone mapping for optimal tone reproduction in color photographs. In this series of patents, the image reproduction is modified by a scene parameter transformation which, when taken in conjunction with untransformed characteristics of the image reproduction system and method, results in a reproduced tone mapping having instantaneous gamma values with a prescribed set of properties. This produces a reproduction having preferred visual characteristics with respect to tones, but does not address the issues of preferred color nor does it provide any method of generating a preferred color reproduction. Such tonal mappings, when applied to color data represented in an additive RGB type of color space, also result in chroma modifications. These chroma modifications are coupled to the tonal mapping and achieve chroma increases only as a consequence of luminance contrast increases. There is no provision in such methods for independent control of luminance and chrominance mappings. Furthermore tonal mappings such as these introduce uncontrolled hue shifts for most colors whenever the tonal mapping deviates from linearity. Another limitation of tonal mappings is that there is no ability to selectively apply the transform to limited regions of the color space.
As mentioned above, in contemporary imaging systems, preferred color rendering is often accomplished through the use of some form of preferred color mapping that is typically achieved through limited, slow and inflexible means. These means include, but are not limited to, modification of tonescales, modifications of selected colors, change of dyes or colorants, or manual manipulation of digital images using products such as Adobe Photoshop®. Because the perception of the light received by the eye and interpreted as a natural image is a very complex process, the subtle color and tonescale changes inherent in natural images are not well accommodated by simple transformations. As a result, a myriad of artifacts and unnatural appearing problems occur. These problems can include transitions between colors across gradients of hue, chroma, or lightness that are not as smooth or continuous as they appear in the natural scene. These transitions may produce artifacts or discontinuities in the image. In addition, the calculations necessary to compute the required transforms are often complex and may require dedicated computational resources and time. The time required for accomplishing the calculations often limits the applicability of the methods because they cannot be done in real time as images are physically produced and as a result must be done off line or else a substantial sacrifice in productivity will result.
What is needed is a completely new algorithm that enables colors to be transformed to produce a preferred color mapping, preferably by moving colors to or toward preferred positions in a color space. Ideally, when natural images are processed, gradations in color or between colors should appear as smooth or sharp in the modified images as they did in the original. Specifically, continuous transitions should be smooth and continuous and should not produce artifacts, discontinuities or contours. In addition, the overall impression of the composition of the image should be such that the rendered image is more pleasing than prior to treatment with the algorithm.
These transitions must also be able to be easily incorporated into systems in which the input color gamut differs from the output color gamut. Shu et al. (U.S. Pat. No. 6,400,843 B1) describe a method for deriving compensation transforms to map colors from an input color gamut to an output color gamut. The method necessitates gamut characterization of both the input and output systems in order to obtain higher-quality color reproduction. Shu et al. do not describe an approach for applying preferred color to, and modifying color gamut of, an input image independent of input and output gamut characterization.
Due to the plethora of combinations of input color systems and output color systems with varying color gamuts, a generic and robust means of applying preferred color transforms to an image is needed. There is a need therefore for an algorithm for moving image colors to or toward preferred positions that avoids the requirement of providing a full characterization of the input and output gamuts of the respective input and output color systems.
SUMMARY OF THE INVENTION
The need is met by providing a method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut that includes the steps of: transforming the color values of the first color space to color values in an intermediate color space; specifying one or more predefined color regions in an intermediate color space; preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color values to fit the second color gamut while restricting the mapping to regions outside of the predefined color regions to produce enhanced modified color values in the intermediate color space; and transforming the modified color values to code values for driving the output device.
ADVANTAGES
The advantageous features of this invention are realized when natural images are processed practicing this invention. Gradations in color or between colors appear as smooth or sharp in the rendered images as they did in the original image. Continuous transitions are smooth and continuous and do not produce artifacts, discontinuities or contours. In addition, the overall impression of the composition of the image is such that the rendered image is more pleasing than prior to treatment with the algorithm. In related technical advantages, the time required to process an image is minimized because the transformation may be generated in a separate, off-line process and used to calculate a three dimensional lookup table that is subsequently used to apply the transformation to images. This can be done because transformations can be constructed that are universally applicable to all natural images, not just a small subclass of images. Thus in operational use, the required calculations are extremely rapid because they only require the application of a single three-dimensional look up table to the pixels in the image. The transformation can be applied to images in a high volume digital photofinishing application in real time.
If the tolerances of the predefined color regions are liberal, the transformation can have broad implementation. This allows for generous modification of the color gamut of the input images. An image with a small input color gamut can be mapped with the transform to a more pleasing image having a color gamut with much larger volume providing that the predefined regions protect and enhance colors with practical significance. For instance, an image with desaturated colors can be transformed to an image with saturated colors providing that color regions such as skin tones are protected from the color gamut expansion. Broad predefined color regions provide a means for operations such as preferentially mapping a color image from an input system with small color gamut to an image with large color gamut. Subsequently, the image can be transferred to an output system with a large color gamut.
These and other aspects, objects, features and advantages of the present invention will be more clearly understood and appreciated from a review of the following detailed description of the preferred embodiments and appended claims, and by reference to the accompanying drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic illustration of the elements controlling the behavior of a color magnet;
FIG. 2 is a diagram of the process for transforming digital color data in accordance with the invention;
FIGS. 3A and 3B together form a diagram of the process for calculating the color magnets algorithm;
FIGS. 4A and B show examples of the effect of an attractive magnet that affects the hue and lightness, as shown on CIELab b* versus a* and L* versus C* diagrams, respectively. The colors are indicated by stars before application of the color magnets algorithm and by triangles after application of the color magnets algorithm;
FIGS. 5A and B show examples of the effect of a repulsive magnet that affects the hue and lightness of green colors having mid-levels of lightness, as shown on CIELab b* versus a* and L* versus C* diagrams, respectively. The colors are indicated by stars before application of the color magnets algorithm and by triangles after application of the color magnets algorithm;
FIGS. 6A and 6B show examples of the effect of a dragnet that changes green colors by increasing chroma and lightness by 10 and decreasing hue by 20, as shown on CIELab b* versus a* and L* versus C* diagrams, respectively. The colors are indicated by stars before application of the color magnets algorithm and by triangles after application of the color magnets algorithm;
FIGS. 7A and B show examples of the effect of a shield that protects skin colors (L*≈50, a*≈25, b*≈25) acting on a magnet that modifies chroma and lightness of all hues, as shown on CIELab b* versus a* and L* versus C* diagrams, respectively. The colors are indicated by stars before application of the color magnets algorithm and by triangles after application of the color magnets algorithm;
FIG. 8 is a perspective diagram of a computer system for implementing the present invention;
FIG. 9 is a high level flow chart showing a method according to the present invention for transforming the gamut of an input digital image to be printed on an output device having a different gamut; and
FIG. 10 is more detailed a flow chart of the method according to the present invention.



DETAILED DESCRIPTION OF THE INVENTION
Because digital image processing algorithms and systems employing color space transformations are well known, the present description will be directed in particular to attributes forming part of, or cooperating more directly with, a color space transformation in accordance with the present invention. Attributes not specifically shown or described herein may be selected from those known in the art. In the following description, a preferred embodiment of the present invention would ordinarily be implemented as software in a computer program. Those skilled in the art will readily recognize that the equivalent of such software may also be constructed in hardware. Given the method as described according to the invention in the following materials, software not specifically shown or suggested herein that would be useful for implementation of the invention is conventional and within the ordinary skill in such arts. Moreover, the computer program may be stored in a computer readable storage medium, which may comprise, for example, magnetic storage media such as a magnetic disk (such as a floppy disk) or magnetic tape; optical storage media such as an optical disc, optical tape, or machine readable bar code; solid state electronic storage devices such as random access memory (RAM), or read only memory (ROM); or any other physical device or medium employed to store a computer program.
This invention relates to a new method that enables colors in an image to be transformed to produce a new color mapping for producing images. It is generally used in the field of digital image processing to modify the colors in a rendered image, or in a digital image in an intermediate stage of processing, in a way that those viewing the images perceive the color to be more preferred. This is accomplished through an algorithm that transforms the color space by attracting, or otherwise moving, colors to or toward preferred positions in a color space in a smooth and naturally appearing manner. The transformation is such that the mapping of colors is accomplished in a smooth and continuous fashion that does not produce artifacts, contours or discontinuities in the image and maintains the appearance of the image as a natural image. Additionally, in certain specific applications, it is possible to dramatically, and intentionally, alter the appearance of an image using color magnets such that the altered image no longer looks like a natural image.
The attraction of colors to or toward preferred positions in a color space in a smooth and naturally appearing manner is obtained by an algorithm that utilizes features herein characterized as “color magnets”. The color magnets transformations described herein are contained in an algorithm that provides a smooth, artifact free means of implementing preferred color transforms in a color reproduction system. “Color magnets”, as used in this disclosure, refers to an algorithm designed to produce color transforms through a mathematical transform as described herein. The term “color magnets” is used herein in the sense of an approximate analogy between the physical effects of attraction and repulsion that physical magnets have on magnetic materials and the effect that the transformation achieved by this invention has on values in a color space to or toward or away from a given point in that color space. It is anticipated that these transforms will typically be used to produce a preferred color mapping for an image or group of images.
In practice, this invention is embodied in an algorithm that allows the user to create a transform that modifies the colors in an image. While it would be feasible to process the digital information representing the colors in an image through the algorithm, a pixel at a time, this could be a slow process. Consequently, the preferred embodiment comprises using the algorithm to produce a multi-dimensional (typically three-dimensional) lookup table of numbers for effecting the transformation. The digital information representing the colors in an image are then processed through the lookup table to produce a new set of digital information representing the desired colors. The algorithm typically works in the CIELab/CIELCh color space but can also be used in any other color space, such as CIELUV color space. The advantage of CIELab/CIELCh is that it is an approximately perceptually uniform space, making the results of the transform easier to predict. In fact, any multi-dimensional color space may be used wherein the dimensions correspond to perceptual attributes of color for human observers, including one or more of lightness, brightness, chroma, colorfulness, saturation and hue. A detailed description of these color spaces can be found in Color Appearance Models by Mark D. Fairchild, Addison-Wesley, (1997).
As expressed in FIG. 1, the behavior 10 of a color magnet, and the color transformation it produces, is controlled by two factors: the region of influence 12 of the magnet, that is, the region of color space that the magnet modifies; and, secondly, the effect 14 that the magnet has on colors within its region of influence. While the functional behavior of a color magnet may be defined such that the region of influence has a definite boundary, it should be understood that the region of influence of the magnets is preferably unbounded in extent given the functional behavior defined below. In this case, consequently, a region of influence is defined as the region in which the “magnetic effect” is greater than a given threshold that would typically cause a visually perceptual change in a color. The region of influence of the magnet is in turn controlled by two factors: the location of the center 16 of the magnet, and the way that the color space distance calculation 18 is defined for the magnet. The effect that the magnet has on colors within its region of influence is in turn controlled by three factors: the type of magnetic behavior 20 ascribed to the magnet (i.e. attract, repel, shield or drag); a function 22 that describes how magnetic effect changes with color space distance (as it is defined for that particular magnet; and the strength factors 24 that allow additional control over the direction of color change within the color space.
The overall method for transforming image color using a color magnets transform, in the form of a multi-dimensional lookup table, in accordance with the invention is shown in FIG. 2. Initially, in step 100 a color space is chosen; as mentioned above, the preferred color space is CIELab/CIELCh color space. Then in a step 110, certain colors are specified that represent the centers of regions of color space that are to be modified. If an attractive magnet is to be specified then this center represents a preferred color position. It may, for example, represent a significant memory color such as skin color, blue sky or green foliage. (An attractive magnet may be used to modify other colors that would not ordinarily be considered significant memory colors; for example, a color magnet may be specified to lower the lightness of saturated reds to bring them inside the gamut of photographic paper.) In the case of a repulsive magnet then the center would represent an undesirable color, or a color around which color differentiation is to be increased. If a shield is to be specified then the color center represents the central color of a region that is to be protected from change. An example of this might be an average Caucasian flesh color. In the case of a dragnet, the color center represents the center of a region of color space that we wish to modify. The color magnets are then assigned coordinate locations in step 120 that match the location of these preferred colors. Since the color magnets exhibit different field characteristics (i.e., attract, repel, shield or drag) that act upon nearby colors, the desired behavior of the color magnets is specified in step 130. Attractive and repulsive type color magnets generate a field-like effect that encompasses and acts upon adjacent colors in the color space. Shield type color magnets exert a protective field on adjacent colors with the extent of protection falling off as distance from the magnet center increases. Dragnets can be pictured as centers to which adjacent colors are linked by anisotropic elastic bonds. The closer a color is to the center of the dragnet, the more strongly it is bound to the dragnet. Colors are also considered to be bound to their current locations by similar elastic bonds. The dragnet center is then moved to a new location in the color space, pulling adjacent colors along with it. Colors closest to the dragnet center, being more strongly bound to it, are dragged closer to the new location than colors that were further from the dragnet center. A regular sampling of colors within the chosen color space is generated in step 140. This is generally achieved by sampling values (uniformly or otherwise) along each of the independent dimensions of the color space and constructing all combinations (a full factorial) of these sampled values to create a grid of fully specified colors within the color space. The grid of colors is mapped through the color magnets algorithm in step 150, resulting in a set of transformed colors within the color space. This set of colors, together with the input set of colors can be used to fully define and construct a multi-dimensional lookup table. In order to apply the color magnets transform to an image it is only necessary to convert the image to the color space chosen in step 100 and to map the image through the multi-dimensional lookup table previously constructed (step 170).
The procedure for using the color magnets algorithm is shown in FIGS. 3A and 3B. In step 200 the locations and behaviors of the color magnets are defined. The behavior of color magnets has been discussed above. Turning now to the location of the center of each magnet, color magnets are assigned a center point location in the working color space. In the CIELab/CIELCh color space for example, the location of the color magnet center is described by a set of three numbers—either Lmambm or LmCmhm representing either L*, a* and b* or L*, C* and h*, where L* represents lightness, a* represents a red-green chromaticity axis, b* represents a yellow-blue chromaticity axis, C* represents chroma, and h* represents hue. Because of the anisotropic behavior allowed to magnets, it can sometimes be misleading to describe magnet location as a single point in color space. Depending on the way that the color space distance calculation is defined, it can sometimes be better to visualize a magnet as a line, a plane, or a cylinder rather than a single point, as will be further elucidated in the material on distance calculation below.
With regard to the way that the color space distance calculation is defined for the magnet, it should be noted that a consequence of the anisotropy of a color space is that color magnets need to be able to display anisotropic behavior. In all color spaces, the three (or more) dimensions of the color space represent different properties of a color. An example of this is the lightness, chroma and hue system. This can be contrasted with a three dimensional geometric space in which all the dimensions represent length. Thus, in the geometric space we expect the same behavior no matter which direction we travel within the space (isotropic behavior). In the color space however, if we move along the lightness dimension we observe color to change in lightness, while if we move along the hue dimension we would see colors change from red to orange to yellow etc., at constant lightness and chroma. Accordingly, if we move a color a fixed distance higher in the lightness dimension it will become lighter, but if we were to move the same distance in the hue dimension it may change from red to yellow (anisotropic behavior).
Turning now to magnet behavior as stated above in relation to FIG. 1, the effect that the magnet has on colors within its region of influence is controlled by three factors: the type of magnetic behavior ascribed to the magnet (i.e. attract, repel, shield or drag); a function that describes how magnetic effect changes with color space distance (as it is defined for that particular magnet); and the strength factors that allow additional control over the direction of color change within the color space. Four types of magnet behavior have been defined in the color magnet algorithm:

    
    
        1. Attraction—the magnet attracts colors to or towards itself.
        2. Repulsion—the magnet repels colors from itself
        3. Dragging—the magnet itself moves in the color space, dragging nearby colors along with it.
        4. Shielding—the effect of the magnet is to shield nearby colors from the effects of other color magnets.
    
    


These behaviors are shown graphically in FIGS. 4 to 7 for each of the behaviors, respectively, in CIELab a* versus b* space and L* versus C* space.
Referring again to FIG. 3, in step 210 the distances between each color and each magnet is calculated. Anisotropy in the calculation of color space distance is introduced by allowing separate weightings for the three dimensions of the color space. Thus, in the CIELab/CIELCh color space the distance, dc,m, of a particular color at location Lcacbc from a magnet at location Lmambm is calculated as follows: 



  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            a
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            a
            m
            *
          
          -
          
            a
            c
            *
          
        
      
    
    
      
        (
        1
        )
      
    
  
  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            b
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            b
            m
            *
          
          -
          
            b
            c
            *
          
        
      
    
    
      
        (
        2
        )
      
    
  
  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            L
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            L
            m
            *
          
          -
          
            L
            c
            *
          
        
      
    
    
      
        (
        3
        )
      
    
  
  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            E
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    L
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            +
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    a
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            +
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    b
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
          
        
      
    
    
      
        (
        4
        )
      
    
  
  
    
      
        
          C
          *
        
        =
        
          
            a
            
              
                *
                2
              
              ⁢
              
                +
                
                  b
                  
                    *
                    2
                  
                
              
            
          
        
      
    
    
      
        (
        5
        )
      
    
  
  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            C
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            C
            m
            *
          
          -
          
            C
            c
            *
          
        
      
    
    
      
        (
        6
        )
      
    
  
  
    
      
        
          Δ
          ⁢
          
             
          
          ⁢
          
            H
            
              c
              ,
              m
            
            *
          
        
        =
        
          
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    E
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            -
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    L
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            -
            
              
                (
                
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    C
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
          
        
      
    
    
      
        (
        7
        )
      
    
  
  
    
      
        
          d
          
            c
            ,
            m
          
        
        =
        
          
            
              
                (
                
                  
                    w
                    
                      L
                      m
                    
                  
                  ⁢
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    L
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            +
            
              
                (
                
                  
                    w
                    
                      C
                      m
                    
                  
                  ⁢
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    C
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
            +
            
              
                (
                
                  
                    w
                    
                      H
                      m
                    
                  
                  ⁢
                  Δ
                  ⁢
                  
                     
                  
                  ⁢
                  
                    H
                    
                      c
                      ,
                      m
                    
                    *
                  
                
                )
              
              2
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




It is apparent from equation 8 above that the weights wLm, wCm and wHm can be used to control the anisotropy in the calculation of color space distance. Each magnet has its own unique set of weights wLm, wCm and wHm and can therefore exhibit different anisotropy from other magnets. As an example, consider a magnet for which WLm is set to zero. This is a magnet that is insensitive to lightness. The shape of this magnet could therefore be considered as a straight line parallel to the L* axis. The distance to colors in the color space therefore depends only on the chroma and hue differences between the magnet and the color in question. Another example is a magnet for which both wLm and wHm are zero. The magnet is therefore insensitive to both lightness and hue. This magnet could be visualized in CIELab space as a cylinder, parallel to the L* axis and with a radius equal to the chroma of the magnet's center.

Step 220 is the calculation of the magnetic effect field of each color magnet, shield and dragnet on all colors in the image or color set. The effect field of a color magnet, as a function of distance from the color magnet center, can be described using any one of a variety of functions. The practical choice of such a function is, however, constrained by a need for desirable characteristics for a color magnet mapping. Desirable characteristics include:

    
    
        Mappings are smooth and continuous and, when applied to images, do not result in abrupt transitions or contours.
        Magnet behavior is predictable and reasonable. That is, magnet effect field is strongest at the location of the magnet center and diminishes with distance. At sufficiently large distances the magnet should have no effect field.
    
    


In order to achieve these characteristics, a mathematical function describing the effect field of a color magnet as a function of distance should preferably have the following properties:

    
    
        The function has a maximum at a distance of zero.
        The function decreases smoothly and continuously as distance increases.
        The function asymptotically approaches zero as distance approaches infinity.
        The function is always non-negative.
        The function has a slope of zero at zero distance.
    
    


While a variety of functions may be used that at least approximate the desirable properties mentioned above, the initial version of color magnets uses either of the two following functions, both having the properties listed above, to describe the magnet effect field, qc,m at color location c resulting from color magnet m, as a function of distance, dc,m. The first of these is a pseudo-Gaussian type of function (equation 9) and the second is an inverse multi-quadric function (equation 10): 



  
    
      
        
          q
          
            c
            ,
            m
          
        
        =
        
          exp
          ⁡
          
            (
            
              
                -
                
                  d
                  
                    c
                    ,
                    m
                  
                  σ
                
              
              
                ρ
                σ
              
            
            )
          
        
      
    
    
      
        (
        9
        )
      
    
  






  
    
      
        
          q
          
            c
            ,
            m
          
        
        =
        
          1
          
            1
            +
            
              
                d
                
                  c
                  ,
                  m
                
                σ
              
              
                10
                ⁢
                
                   
                
                ⁢
                ρ
              
            
          
        
      
    
    
      
        (
        10
        )
      
    
  




In equations 9 and 10, σ is a parameter that controls the slope and ρ is a parameter that controls the width of the effect field function. The use of a factor of 10 ρ in the denominator of 10 is arbitrary and is chosen to make the half width of 10 similar to that of 9.
At this point (step 230) in the algorithm it is necessary to separate the shields from the other magnets and dragnets. This is because of their fundamentally different types of behavior magnets and dragnets act to move colors within the color space while shields act to prevent movement of colors by attenuating the effects of magnets and dragnets.
Step 240 is the calculation of the effect field of each magnet or dragnet on every other magnet or dragnet. This calculation is entirely analogous to that summarized in equations 9 and 10 and is given by equations 11 and 12 for the two example effect field functions. 



  
    
      
        
          q
          
            
              m
              1
            
            ,
            
              m
              2
            
          
        
        =
        
          exp
          ⁡
          
            (
            
              
                -
                
                  d
                  
                    
                      m
                      1
                    
                    ,
                    
                      m
                      2
                    
                  
                  
                    σ
                    
                      m
                      ⁢
                      
                         
                      
                      ⁢
                      1
                    
                  
                
              
              
                ρ
                
                  m
                  1
                
                
                  σ
                  m1
                
              
            
            )
          
        
      
    
    
      
        (
        11
        )
      
    
  
  
    
      
        
          q
          
            
              m
              1
            
            ,
            
              m
              2
            
          
        
        =
        
          1
          
            1
            +
            
              
                d
                
                  
                    m
                    1
                  
                  ,
                  
                    m
                    2
                  
                
                
                  σ
                  
                    m
                    1
                  
                
              
              
                10
                ⁢
                
                   
                
                ⁢
                
                  ρ
                  
                    m
                    1
                  
                
              
            
          
        
      
    
    
      
        (
        12
        )
      
    
  




In these equations, qm1,m2 is the magnetic effect field of magnet m1 on magnet m2, dm1,m2 is the color space distance from magnet m1 to magnet m2 calculated using the distance anisotropy weightings assigned to magnet m1, σm1 is the slope parameter assigned to magnet m1 and ρm1 is the width parameter assigned to magnet m1.
In order to ensure smooth and consistent movement of colors within the color space when colors are being influenced simultaneously by multiple magnets and dragnets we must perform a normalization of the effect fields. This is accomplished in step 250. In general, there will be a set of j magnets all simultaneously acting on all k colors in a color set. These j magnets comprise a total of μ attractive and repulsive magnets and η dragnets. It is desirable that colors that are exactly at the location of an attractive magnet are not moved away by the influence of other magnets. This problem is analogous to a multi-dimensional scattered data interpolation problem where it is desirable to reproduce data points exactly while interpolating smoothly between them. One simple approach to this problem is the method of inverse distance interpolation as discussed in Mathematics of Computation, Volume 38, pp. 181-200, (1982) by Richard Franke. Other interpolation methods described in this reference would be similarly applicable.
Following this method, interpolation for attractive color magnets is implemented as follows. The magnetic effect field of each magnet on each color is represented by matrix Qc,m and the magnetic effect field of each magnet on each other magnet by matrix Pm,m: 



  
    
      
        
          
            Q
            
              c
              ,
              m
            
          
          =
          
            [
            
              
                
                  
                    q
                    
                      
                        c
                        1
                      
                      ,
                      
                        m
                        1
                      
                    
                  
                
                
                  
                    q
                    
                      
                        c
                        1
                      
                      ,
                      
                        m
                        2
                      
                    
                  
                
                
                  ...
                
                
                  
                    q
                    
                      
                        c
                        1
                      
                      ,
                      
                        m
                        j
                      
                    
                  
                
              
              
                
                  
                    q
                    
                      
                        c
                        2
                      
                      ,
                      
                        m
                        1
                      
                    
                  
                
                
                  
                    q
                    
                      
                        c
                        2
                      
                      ,
                      
                        m
                        2
                      
                    
                  
                
                
                  ...
                
                
                  
                    q
                    
                      
                        c
                        2
                      
                      ,
                      
                        m
                        j
                      
                    
                  
                
              
              
                
                  ⋮
                
                
                  ⋮
                
                
                  ⋱
                
                
                  ⋮
                
              
              
                
                  
                    q
                    
                      
                        c
                        k
                      
                      ,
                      
                        m
                        1
                      
                    
                  
                
                
                  
                    q
                    
                      
                        c
                        k
                      
                      ,
                      
                        m
                        2
                      
                    
                  
                
                
                  ...
                
                
                  
                    q
                    
                      
                        c
                        k
                      
                      ,
                      
                        m
                        j
                      
                    
                  
                
              
            
            ]
          
        
        ⁢
        
          

        
      
    
    
      
        (
        13
        )
      
    
  
  
    
      
        
          P
          
            m
            ,
            m
          
        
        =
        
          [
          
            
              
                
                  q
                  
                    
                      m
                      1
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      m
                      1
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ...
              
              
                
                  q
                  
                    
                      m
                      1
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
            
              
                
                  q
                  
                    
                      m
                      2
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      m
                      2
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ...
              
              
                
                  q
                  
                    
                      m
                      2
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
            
              
                ⋮
              
              
                ⋮
              
              
                ⋱
              
              
                ⋮
              
            
            
              
                
                  q
                  
                    
                      m
                      j
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      m
                      j
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ⋯
              
              
                
                  q
                  
                    
                      m
                      j
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
          
          ]
        
      
    
    
      
        (
        14
        )
      
    
  




(Note: Because each magnet can display unique anisotropy, the matrix Pm,m is not generally symmetric.) The normalized attraction matrix Nc,m is then calculated as follows: 



  
    
      
        
          N
          
            c
            ,
            m
          
        
        =
        
          
            [
            
              
                P
                
                  m
                  ,
                  m
                
                
                  -
                  1
                
              
              ⁢
              
                Q
                
                  c
                  ,
                  m
                
                T
              
            
            ]
          
          T
        
      
    
    
      
        (
        15
        )
      
    
  




The normalized attraction matrix has k rows and j columns as follows: 



  
    
      
        
          N
          
            c
            ,
            m
          
        
        =
        
          [
          
            
              
                
                  n
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  n
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ...
              
              
                
                  n
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
            
              
                
                  n
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  n
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ...
              
              
                
                  n
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
            
              
                ⋯
              
              
                ⋯
              
              
                ⋱
              
              
                ⋮
              
            
            
              
                
                  n
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      1
                    
                  
                
              
              
                
                  n
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      2
                    
                  
                
              
              
                ⋯
              
              
                
                  n
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      j
                    
                  
                
              
            
          
          ]
        
      
    
    
      
        (
        16
        )
      
    
  




In step 260, the total shielding, from the combined effect of all shields, on each color is calculated. The shielding behavior of a color to a color magnet, as a function of color space distance between the color magnet center and the color, can be described by using a matrix. If there are i shields simultaneously acting on k colors in a color set or image, then the shielding effect field on each color by each shield can be represented by the matrix Rs,m. 



  
    
      
        
          R
          
            s
            ,
            m
          
        
        =
        
          [
          
            
              
                
                  q
                  
                    
                      c
                      1
                    
                    ,
                    
                      s
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      c
                      1
                    
                    ,
                    
                      s
                      2
                    
                  
                
              
              
                ...
              
              
                
                  q
                  
                    
                      c
                      1
                    
                    ,
                    
                      s
                      i
                    
                  
                
              
            
            
              
                
                  q
                  
                    
                      c
                      2
                    
                    ,
                    
                      s
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      c
                      2
                    
                    ,
                    
                      s
                      2
                    
                  
                
              
              
                ...
              
              
                
                  q
                  
                    
                      c
                      2
                    
                    ,
                    
                      s
                      i
                    
                  
                
              
            
            
              
                ⋮
              
              
                ⋮
              
              
                ⋱
              
              
                ⋮
              
            
            
              
                
                  q
                  
                    
                      c
                      k
                    
                    ,
                    
                      s
                      1
                    
                  
                
              
              
                
                  q
                  
                    
                      c
                      k
                    
                    ,
                    
                      s
                      2
                    
                  
                
              
              
                ⋯
              
              
                
                  q
                  
                    
                      c
                      k
                    
                    ,
                    
                      s
                      i
                    
                  
                
              
            
          
          ]
        
      
    
    
      
        (
        17
        )
      
    
  




We now calculate the total shielding for each color, c, in the lightness, chroma and hue dimensions. In the matrix TotalRLCHc, total lightness shielding is found in column 1, total chroma shielding is in column 2 and total hue shielding is in column 3: 



  
    
      
        
          
            R
            
              LCH
              c
            
            
            
              
              Total
          
          =
          
            [
            
              
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            L
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  1
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            C
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  1
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            H
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  1
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
              
              
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            L
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  2
                                
                                ⁢
                                
                                  
                                    s
                                    ⁢
                                    
                                       
                                    
                                  
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            C
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  2
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            H
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  2
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
              
              
                
                  ⋮
                
                
                  ⋮
                
                
                  ⋮
                
              
              
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            L
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  k
                                
                                ⁢
                                
                                  
                                    s
                                    ⁢
                                    
                                       
                                    
                                  
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            C
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  k
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    1
                    -
                    
                      
                        ∏
                        
                          α
                          =
                          1
                        
                        i
                      
                      ⁢
                      
                         
                      
                      ⁢
                      
                        
                          A
                          
                            H
                            α
                          
                        
                        ⁡
                        
                          (
                          
                            1
                            -
                            
                              q
                              
                                
                                  c
                                  k
                                
                                ⁢
                                
                                  s
                                  α
                                
                              
                            
                          
                          )
                        
                      
                    
                  
                
              
            
            ]
          
        
        ⁢
        
          

        
      
    
    
      
        [
        18
        ]
      
    
  
  
    
      
        
          R
          
            LCH
            c
          
          
          
            
            Total
        
        =
        
          [
          
            
              
                
                  r
                  
                    L
                    1
                  
                
              
              
                
                  r
                  
                    C
                    1
                  
                
              
              
                
                  r
                  
                    H
                    1
                  
                
              
            
            
              
                
                  r
                  
                    L
                    2
                  
                
              
              
                
                  r
                  
                    C
                    2
                  
                
              
              
                
                  r
                  
                    H
                    2
                  
                
              
            
            
              
                ⋮
              
              
                ⋮
              
              
                ⋮
              
            
            
              
                
                  r
                  
                    L
                    k
                  
                
              
              
                
                  r
                  
                    C
                    k
                  
                
              
              
                
                  r
                  
                    H
                    k
                  
                
              
            
          
          ]
        
      
    
    
      
        [
        19
        ]
      
    
  




The constants ALα, ACα and AHα are the strength values of shield α for the lightness, chroma and hue color dimensions respectively.

In step 270 of the method the ‘force’ of each magnet, accounting for shielding, on each color is calculated. In equation 20 the n terms are from the normalized attraction matrix (equation 16) and the r terms are from the total shielding matrix (equation 19): 



  
    
      
        
          F
          
            c
            ,
            m
          
        
        =
        
          
            [
            
              
                
                  
                    
                      n
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          1
                        
                      
                      )
                    
                  
                
                
                  
                    
                      n
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          2
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          1
                        
                      
                      )
                    
                  
                
                
                  ...
                
                
                  
                    
                      n
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          1
                        
                      
                      )
                    
                  
                
              
              
                
                  
                    
                      n
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          2
                        
                      
                      )
                    
                  
                
                
                  
                    
                      n
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          2
                        
                      
                      )
                    
                  
                
                
                  ...
                
                
                  
                    
                      n
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          2
                        
                      
                      )
                    
                  
                
              
              
                
                  ...
                
                
                  ...
                
                
                  ...
                
                
                  ⋮
                
              
              
                
                  
                    
                      n
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          k
                        
                      
                      )
                    
                  
                
                
                  
                    
                      n
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          2
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          k
                        
                      
                      )
                    
                  
                
                
                  ...
                
                
                  
                    
                      n
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                    ⁡
                    
                      (
                      
                        1
                        -
                        
                          r
                          k
                        
                      
                      )
                    
                  
                
              
            
            ]
          
          =
          
             
            
              [
              
                
                  
                    
                      f
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                  
                  
                    
                      f
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          2
                        
                      
                    
                  
                  
                    ...
                  
                  
                    
                      f
                      
                        
                          c
                          1
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                  
                
                
                  
                    
                      f
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                  
                  
                    
                      f
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          2
                        
                      
                    
                  
                  
                    ...
                  
                  
                    
                      f
                      
                        
                          c
                          2
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                  
                
                
                  
                    ...
                  
                  
                    ...
                  
                  
                    ⋱
                  
                  
                    ⋮
                  
                
                
                  
                    
                      f
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          1
                        
                      
                    
                  
                  
                    
                      f
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          2
                        
                      
                    
                  
                  
                    ...
                  
                  
                    
                      f
                      
                        
                          c
                          k
                        
                        ,
                        
                          m
                          j
                        
                      
                    
                  
                
              
              ]
            
          
        
      
    
    
      
        (
        20
        )
      
    
  




Steps 280, 290 and 300 of the method describe the calculation of the change in lightness hue and chroma of each color due to the action of all of the magnets. The calculations here are slightly different for magnets and dragnets, so in step 280 the dragnets are sorted from the attractive and repulsive magnets.
Dealing with attractive and repulsive magnets only in step 290 the change in lightness, and chroma and hue of each color due to the combined action of all of the magnets, allowing for shielding is calculated in the following equation 21: 



  
    
      
         
        
          
             
          
          magnets
        
      
      ⁢
      Δ
    
    ⁢
    
       
    
    ⁢
    
      LCH
      c
    
  
  =
  
     
    
      [
      
        
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    L
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  L
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    C
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  C
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    H
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  H
                  
                    
                      c
                      1
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
        
        
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    L
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  L
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    C
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  C
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    H
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  H
                  
                    
                      c
                      2
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
        
        
          
            ⋮
          
          
            ⋮
          
          
            ⋮
          
        
        
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    L
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  L
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    C
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  C
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
          
            
              
                ∑
                
                  α
                  =
                  1
                
                μ
              
              ⁢
              
                
                  g
                  α
                
                ⁢
                
                  A
                  
                    H
                    α
                  
                
                ⁢
                
                  f
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                
                ⁢
                Δ
                ⁢
                
                   
                
                ⁢
                
                  H
                  
                    
                      c
                      k
                    
                    ,
                    
                      m
                      α
                    
                  
                  *
                
              
            
          
        
      
      ]
    
  




In equation 21, μ is the total number of attractive and repulsive magnets and gα takes the value +1 if magnet α is an attractive magnet and −1 if magnet α is a repulsive magnet. The constants ALα, ACα and AHα are the strength values of magnet α for the lightness, chroma and hue color dimensions respectively. The changes in lightness are in column 1 of the matrix while changes in hue and chroma can be found in columns 2 and 3 respectively.
In step 300 the change in lightness, chroma and hue of each color due to the combined action of all of the dragnets, allowing for shielding is calculated as follows: 



  
    
      
        
          
            
               
              
                
                   
                
                dragnets
              
            
            ⁢
            Δ
          
          ⁢
          
             
          
          ⁢
          
            LCH
            c
          
        
        =
        
           
          
            [
            
              
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            1
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        L
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            1
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        C
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            1
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        H
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
              
              
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            2
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        L
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            2
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        C
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            2
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        H
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
              
              
                
                  ⋮
                
                
                  ⋮
                
                
                  ⋮
                
              
              
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            k
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        L
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            k
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        C
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
                
                  
                    
                      ∑
                      
                        α
                        =
                        1
                      
                      η
                    
                    ⁢
                    
                       
                    
                    ⁢
                    
                      
                        f
                        
                          
                            c
                            k
                          
                          ,
                          
                            m
                            α
                          
                        
                      
                      ⁢
                      Δ
                      ⁢
                      
                         
                      
                      ⁢
                      
                        H
                        
                          m
                          α
                        
                        *
                      
                    
                  
                
              
            
            ]
          
        
      
    
    
      
        (
        22
        )
      
    
  




In equation 22, η is the total number of dragnets. The constants 



  
    Δ
    ⁢
    
       
    
    ⁢
    
      L
      
        m
        α
      
      *
    
  
  ,
  
    Δ
    ⁢
    
       
    
    ⁢
    
      C
      
        m
        α
      
      *
    
  




and 



  Δ
  ⁢
  
     
  
  ⁢
  
    H
    
      m
      α
    
    *
  




are the shift (or drag) distances for dragnet α in the lightness, chroma and hue color dimensions respectively.

The transformed colors are now calculated in step 310 according to equation 23, where, if the original colors are represented as LCH, then the new colors LCH′ are:

LCH′=LCH+magnetsΔLCH+dragnetsΔLCH  (23)

It should be remembered that equation 23 represents vector addition and that hue is a periodic dimension.

While the overall methodology of the invention is described above, the invention can be embodied in any number of different types of systems and executed in any number of different ways, as would be known by one ordinarily skilled in the art. For example, as illustrated in FIG. 8, a typical hardware configuration of an information handling/computer system in accordance with the invention preferably has at least one processor or central processing unit (CPU) 400. The CPU 400 is interconnected via a system bus 410 to a random access memory (RAM) 420, a read-only memory (ROM) 430, an input/output (I/O) adapter 440 (for connecting peripheral devices such as disk units 450 and tape drives 460 to the bus 410), a communication adapter 470 (for connecting an information handling system to a data processing network), a user interface adapter 480 (for connecting peripherals 490, 500, 510 such as a keyboard, mouse, digital image input unit, microphone, speaker and/or other user interface device to the bus 410), a printer 520 and a display adapter 530 (for connecting the bus 410 to a display device 540). The invention could be implemented using the structure shown in FIG. 8 by including the inventive method within a computer program stored on the storage device 450. Such a computer program would act on an image frame supplied through the interface units 490, 500, 510 or through the network connection 470. The system would then automatically produce the desired color space transformation, which would provide the improved images to the display 540, to the printer 520 or back to the network 470. In the preferred embodiment, the coefficients for the transformations would be predetermined (precalculated) for given magnets at given preferred locations and stored in look up tables in memory such as the disk drive 450. Then, the actual conversion of the digital color data would involve accessing the look up tables to determine the transformed code value for each input code value.
When natural images are processed practicing this invention, gradations in color or between colors appear smooth or sharp in the rendered images as they did in the original image. Specifically continuous transitions are smooth and continuous and do not produce artifacts, discontinuities or contours. In addition, the overall impression of the composition of the image is such that the rendered image is more pleasing than prior to treatment with the algorithm. The time required to process an image is minimized because the transformation is calculated off line. This can be done because the transformation is universally applicable to all natural images, not just a small subclass of images. Thus in operational use, the required calculations are extremely rapid because they only require the application of a single three-dimensional look up table to the pixels in the image. The transformation can be applied to images in a high volume digital photofinishing application in real time.
The present invention is particularly useful in transforming the gamut of a digital image that is to be printed on an output device having a different (e.g. larger) gamut. An output device with a larger gamut than the gamut of the input digital image allows for the expansion of the color gamut digital image to enhance the appearance of the digital image. Various amounts of gamut expansion surrounding the predefined color regions can be selected. This allows the preferred color gamut position to be variable and controllable.
Referring to FIG. 9, a method for transforming the gamut of an input digital image 600, having a Gamut 1 and expressed in an input device dependent color space, to be printed on an output device having a different color gamut (Gamut 2) includes the steps of transforming 602 the input digital image into a device independent, intermediate color space 604 using any of the following methods in combination or alone: one-dimensional and three-dimensional look up tables (1D LUTs and 3D LUTs), matrices, mathematical equations and ICC profiles (International Color Consortium, Specification ICC.1:2001-12). For example, an RGB input image can be transformed into CIELAB values using a 3D LUT. Once in intermediate color space, the image is enhanced 606 by smoothly translating (as described above) the color values to fit the second color gamut while restricting the mapping to regions outside of predefined color regions to produce enhanced modified color values in the intermediate color space. The modification employs image gamut changes, in particular changes in the chroma (C*) values of the image, in regions surrounding selected predefined color regions. For example, the image gamut can be globally increased in all regions except for the predefined color regions.
The transform is constructed based on two or more color magnets of any type of magnetic behavior (attract, repel, shield and drag), which modify the chroma (C*) values of the image. In addition, these magnets can affect the other dimensions of color, e.g. lightness, hue. The desired modified color values in the intermediate space are calculated based on the suite of equations 1-23. While these calculations can be performed on the image on a pixel by pixel basis, it is more efficient to construct 3D LUTs or ICC profiles to perform the mapping. In the preferred embodiment of this invention the transformation is implemented as an abstract ICC profile in Profile Connection Space (PCS, Specification ICC.1:2001-12).
Finally, using any of the following methods in combination or alone: one-dimensional and three-dimensional look up tables (ID LUTs and 3D LUTs), matrices, mathematical equations and ICC profiles, the color digital image is transformed 608 into code values in a device dependent output space to produce a color digital image 610 having Gamut 2.
The method of constructing the transform in the intermediate device-independent color space is described in more detail with reference to FIG. 10. The input color space, such as RGB, is identified 700. A device independent, intermediate color space is selected 702. Preferably the intermediate color space is an approximately perceptually uniform color space, such as CIELAB. The input digital image 704 is then transformed 706 to the selected intermediate color space. Next, predetermined color regions and associated tolerances are specified 708 to designate color regions for shielding from modification, and to define color magnets to allow for specified modification of the gamuts of the predetermined color regions. For example, the skin tone region can be shielded from any modifications whereas other regions can be greatly modified. This allows for modifications and enhancements in image gamut which translate to preferential image enhancement.
In the preferred embodiment of the invention the regions selected for shielding include near neutral colors, a large region encompassing skin tones and other natural colors, e.g., hair, sand, bark; and very saturated colors that are out of gamut for most output media and devices, in particular:
A chroma shield placed at a*=b*=0 and any L* value between 1 and 100, which shields all colors below a predefined maximum C* value between 10 and 20. According to Equations 9, 10 the shielding effect decreases smoothly between the neutral at C*=0 and the predefined maximum C* values.
A chroma shield for skin tones and other natural colors is preferably placed at C* values between 10 and 30 and a*/b* hue angles, hab*, between 40 and 50 degrees and any L* value between 1 and 100. The recommended overall size of the color region, defined as distance from minimum to maximum, shielded around the center falls between 20 and 60 Cab* units and 20 to 70 hue angle (hab*) units.
A chroma shield can be placed at a highly saturated color at a C* value between 80 and 120 and any L* value and hue angle. The recommended overall range of colors shielded around the origin of the magnet is 20 to 90 C* units. In addition other magnets that affect all three dimensions of colors (lightness, chroma and hue) can be placed at colors near the gamut of the output system to make optimum use of the gamut of this system.
Additional chroma shields can be placed at other color locations, e.g. trademark colors or other natural colors, such as foliage green. The recommended overall range of colors shielded around the center of the shield is between 10 and 30 C* units, 10 to 30 hue angle (hab*) units and 10 to 60 L* (lightness) units from minimum to maximum.
In the preferred embodiment of the invention, the gamut of the image can be expanded by defining a magnet with repelling behavior at a neutral color (a*=b*=0 and any L* value). The strength of the magnet, defined as ALα, ACα and AHα in Equation 21 determines the ratio between enhanced C* values and original C* values in the intermediate space. Ratios between 1.1 and 1.6 are recommended. Because several predefined regions are shielded from the effect of this magnet it is recommended to specify a large half width (ρ>100, Equations 9, 10) for this magnet. Alternatively chroma enhancements can be implemented using dragnets or attractive magnets placed at highly saturated colors.
By utilizing the predetermined color regions and tolerances, gamut modifications can be made to the image in a way that allows for a more robust implementation of gamut adjustment. Given that the color content and the quality of the image passing through the system are unknown, the present invention preserves a natural rendition of skin tones, is forgiving towards errors in the white balance of the image and allows the optimum usage of the color gamut of the output system.
A preferential gamut mapping is then constructed 710 using the designated color magnets and shielding. The gamut mapping is then applied 712 to the digital image in the intermediate color space. Finally, the modified image is then transformed 714 into code value in an output device dependent color space.
The invention has been described in detail with particular reference to certain preferred embodiments thereof, but it will be understood that variations and modifications can be effected within the spirit and scope of the invention.
PARTS LIST


    10 behavior of a color magnet
    12 region of influence
    14 effect
    16 location of center
    18 color space distance calculation
    20 magnetic behavior
    22 function
    24 strength factors
    100-170 steps
    200-310 steps
    400 CPU
    410 bus
    420 RAM
    430 ROM
    440 I/O adapter
    450 disk unit
    460 tape drive
    470 communication adapter
    480 interface adapter
    490 keyboard
    500 mouse
    510 digital image input unit
    520 printer
    530 display adapter
    540 display device
    600 input digital image
    602 transform image step
    604 intermediate color space
    606 enhance image step
    608 transform image step
    610 color digital image
    700 identify input color space step
    702 select device independent step
    704 input digital image
    706 transform image step
    708 specify predetermined color regions and associated tolerances
    710 determine gamut mapping step
    712 apply gamut mapping to image
    714 transform image step

## Claims

1. A method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut, comprising the steps of:
a) transforming the color values of the first color space to color values in an intermediate color space; 
b) specifying one or more predefined color regions in an intermediate color space; 
c) preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color value to fit the second color gamut using one or more color magnets while shielding the predefined color regions using shielding color magnets to produce enhanced modified color values in the intermediate color space; and 
d) transforming the modified color values to code values for driving the output device.

2. The method claimed in claim 1, wherein the intermediate color space is an approximately perceptually uniform color space.

3. The method claimed in claim 2, wherein the intermediate color space is CIELAB.

4. The method claimed in claim 1, wherein the transform for converting the digital color image signal to code values is expressed as one or a succession of multidimensional lookup tables.

5. The method claimed in claim 1, wherein the transform for converting the digital color image signal to code values is expressed as an ICC profile or a concatenation of several ICC profiles.

6. The method claimed in claim 1, wherein the predefined color regions are skin tone and other natural colors such as sand and bark.

7. The method claimed in claim 6 where the center of the skin tone region is placed at CIELAB chroma, Cab*, values between 10 and 30, a*/b* hue angles, hab*, between 40 and 50 degrees and any lightness, L*, value between 1 and 100, while the overall size of the color region, defined as distance from minimum to maximum, shielded around the center falls between 20 and 60 Cab* units and 20 to 70 ab* units.

8. The method claimed in claim 1, wherein the predefined color region includes neutral and near neutral colors.

9. The method claimed in claim 8, where the center of the neutral region is placed at CIELAB chroma, Cab*, values between 0 and 5, and any a*/b* hue angle, hab*, and lightness value, L*, while the overall size of the color region, defined as distance from minimum to maximum, shielded around the center falls between 10 and 20 Cab* units, encompassing all hue and lightness values.

10. The method claimed in claim 1, wherein the predefined color regions are trademark colors.

11. The method claimed in claim 1, where the mapping of colors in the intermediate color space outside the predetermined color regions is such that the initial CIELAB chroma values, Cab* in the intermediate color space are increased by a factor of 1.1 to 1.6.

12. The method claimed in claim 1, where step c) is implemented as an abstract ICC profile in ICC Profile Connection space.

13. The method claimed in claim 1, wherein the output device is an inkjet printer.

14. The method claimed in claim 5, wherein the intermediate color space is CIELAB and the predefined color regions are skin tone and other natural colors such as sand and bark.

15. A method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut, comprising the steps of:
a) transforming the color values of the first color space to color values in an intermediate color space; 
b) specifying one or more predefined color regions in an intermediate color space wherein the predefined color regions include skin tone at CIELAB chroma, Cab*, values between 10 and 30, a*/b* hue angles, hab*, between 40 and 50 degrees and any lightness, L*, value between 1 and 100, while the overall size of the color region, defined as distance from minimum to maximum, shielded around the center falls between 20 and 60 Cab* units and 20 to 70 hab* units. 
c) preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color values to fit the second color gamut while restricting the mapping to regions outside of the predefined color regions to produce enhanced modified color values in the intermediate color space; and 
d) transforming the modified color values to code values for driving the output device.

16. A method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut, comprising the steps of:
a) transforming the color values of the first color space to color values in an intermediate color space; 
b) specifying one or more predefined color regions in an intermediate color space wherein one predefined color region includes neutral and near neutral colors centered at CIELAB chroma, Cab*, values between 0 and 5, and any a*/b* hue angle, hab*, and lightness value, L*, while the overall size of the color region, defined as distance from minimum to maximum, shielded around the center falls between 10 and 20 Cab* units, encompassing all hue and lightness values; 
c) preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color values to fit the second color gamut while restricting the mapping to regions outside of the predefined color regions to produce enhanced modified color values in the intermediate color space; and 
d) transforming the modified color values to code values for driving the output device.

17. A method for generating a transform for converting a digital color image signal expressed as color values in a first color space having a first color gamut to code values for driving an output device having a second color gamut different from the first color gamut, comprising the steps of:
a) transforming the color values of the first color space to color values in an intermediate color space; 
b) specifying one or more predefined color regions in an intermediate color space; 
c) preferentially mapping the color values in the intermediate color space into the second color gamut by smoothly translating the color values to fit the second color gamut such that the initial CIELAB chroma values, Cab* in the intermediate color space are increased by a factor of 1.1 to 1.6. while restricting the mapping to regions outside of the predefined color regions to produce enhanced modified color values in the intermediate color space; and 
d) transforming the modified color values to code values for driving the output device.