Package org.apache.commons.imaging

## Class ColorTools

- java.lang.Object
- - org.apache.commons.imaging.ColorTools

-     public class ColorTools
      extends Object

  A selection of tools for evaluating and manipulating color spaces, color values, etc.

  The Javadoc provided in the original code gave the following notation:
  "This class is a mess and needs to be cleaned up."

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ColorTools()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `BufferedImage` | `convertBetweenColorSpaces​(BufferedImage bi, ColorSpace from, ColorSpace to)` |
    `BufferedImage` | `convertBetweenColorSpacesX2​(BufferedImage bi, ColorSpace from, ColorSpace to)` |
    `BufferedImage` | `convertBetweenICCProfiles​(BufferedImage bi, ICC_Profile from, ICC_Profile to)` |
    `protected BufferedImage` | `convertFromColorSpace​(BufferedImage bi, ColorSpace from)` |
    `BufferedImage` | `convertToColorSpace​(BufferedImage bi, ColorSpace to)` |
    `BufferedImage` | `convertToICCProfile​(BufferedImage bi, ICC_Profile to)` |
    `BufferedImage` | `convertTosRGB​(BufferedImage bi)` |
    `BufferedImage` | `correctImage​(BufferedImage src, File file)` |
    `ColorModel` | `deriveColorModel​(BufferedImage bi, ColorSpace cs)` |
    `ColorModel` | `deriveColorModel​(BufferedImage bi, ColorSpace cs, boolean forceNoAlpha)` |
    `ColorModel` | `deriveColorModel​(ColorModel colorModel, ColorSpace cs, boolean forceNoAlpha)` |
    `BufferedImage` | `relabelColorSpace​(BufferedImage bi, ColorSpace cs)` |
    `BufferedImage` | `relabelColorSpace​(BufferedImage bi, ICC_Profile profile)` |
    `BufferedImage` | `relabelColorSpace​(BufferedImage bi, ColorModel cm)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ColorTools

          public ColorTools()

  - ### Method Detail

    - #### correctImage

          public BufferedImage correctImage​(BufferedImage src,
                                            File file)
                                     throws ImageReadException,
                                            IOException

      Throws:
        `ImageReadException`
        `IOException`

    - #### relabelColorSpace

          public BufferedImage relabelColorSpace​(BufferedImage bi,
                                                 ICC_Profile profile)
                                          throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### relabelColorSpace

          public BufferedImage relabelColorSpace​(BufferedImage bi,
                                                 ColorSpace cs)
                                          throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### relabelColorSpace

          public BufferedImage relabelColorSpace​(BufferedImage bi,
                                                 ColorModel cm)
                                          throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### deriveColorModel

          public ColorModel deriveColorModel​(BufferedImage bi,
                                             ColorSpace cs)
                                      throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### deriveColorModel

          public ColorModel deriveColorModel​(BufferedImage bi,
                                             ColorSpace cs,
                                             boolean forceNoAlpha)
                                      throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### deriveColorModel

          public ColorModel deriveColorModel​(ColorModel colorModel,
                                             ColorSpace cs,
                                             boolean forceNoAlpha)
                                      throws ImagingOpException

      Throws:
        `ImagingOpException`

    - #### convertToColorSpace

          public BufferedImage convertToColorSpace​(BufferedImage bi,
                                                   ColorSpace to)

    - #### convertTosRGB

          public BufferedImage convertTosRGB​(BufferedImage bi)

    - #### convertFromColorSpace

          protected BufferedImage convertFromColorSpace​(BufferedImage bi,
                                                        ColorSpace from)

    - #### convertBetweenICCProfiles

          public BufferedImage convertBetweenICCProfiles​(BufferedImage bi,
                                                         ICC_Profile from,
                                                         ICC_Profile to)

    - #### convertToICCProfile

          public BufferedImage convertToICCProfile​(BufferedImage bi,
                                                   ICC_Profile to)

    - #### convertBetweenColorSpacesX2

          public BufferedImage convertBetweenColorSpacesX2​(BufferedImage bi,
                                                           ColorSpace from,
                                                           ColorSpace to)

    - #### convertBetweenColorSpaces

          public BufferedImage convertBetweenColorSpaces​(BufferedImage bi,
                                                         ColorSpace from,
                                                         ColorSpace to)