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:

TODO"This class is a mess and needs to be cleaned up."

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ColorTools()`

- ## Method Summary

  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 Details

  - ### ColorTools

    public ColorTools()

- ## Method Details

  - ### convertBetweenColorSpaces

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

  - ### convertBetweenColorSpacesX2

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

  - ### convertBetweenIccProfiles

    public BufferedImage convertBetweenIccProfiles(BufferedImage bi, ICC_Profile from, ICC_Profile to)

  - ### convertFromColorSpace

    protected BufferedImage convertFromColorSpace(BufferedImage bi, ColorSpace from)

  - ### convertToColorSpace

    public BufferedImage convertToColorSpace(BufferedImage bi, ColorSpace to)

  - ### convertToIccProfile

    public BufferedImage convertToIccProfile(BufferedImage bi, ICC_Profile to)

  - ### convertTosRgb

    public BufferedImage convertTosRgb(BufferedImage bi)

  - ### correctImage

    public BufferedImage correctImage(BufferedImage src, File file) throws ImagingException, IOException
    Throws:
      `ImagingException`
      `IOException`

  - ### 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`

  - ### relabelColorSpace

    public BufferedImage relabelColorSpace(BufferedImage bi, ColorModel cm) throws ImagingOpException
    Throws:
      `ImagingOpException`

  - ### relabelColorSpace

    public BufferedImage relabelColorSpace(BufferedImage bi, ColorSpace cs) throws ImagingOpException
    Throws:
      `ImagingOpException`

  - ### relabelColorSpace

    public BufferedImage relabelColorSpace(BufferedImage bi, ICC_Profile profile) throws ImagingOpException
    Throws:
      `ImagingOpException`