Class ColorTools


  • public class ColorTools
    extends java.lang.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
      java.awt.image.BufferedImage convertBetweenColorSpaces​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace from, java.awt.color.ColorSpace to)  
      java.awt.image.BufferedImage convertBetweenColorSpacesX2​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace from, java.awt.color.ColorSpace to)  
      java.awt.image.BufferedImage convertBetweenICCProfiles​(java.awt.image.BufferedImage bi, java.awt.color.ICC_Profile from, java.awt.color.ICC_Profile to)  
      java.awt.image.BufferedImage convertToColorSpace​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace to)  
      java.awt.image.BufferedImage convertToICCProfile​(java.awt.image.BufferedImage bi, java.awt.color.ICC_Profile to)  
      java.awt.image.BufferedImage convertTosRGB​(java.awt.image.BufferedImage bi)  
      java.awt.image.BufferedImage correctImage​(java.awt.image.BufferedImage src, java.io.File file)  
      java.awt.image.ColorModel deriveColorModel​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace cs)  
      java.awt.image.ColorModel deriveColorModel​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace cs, boolean forceNoAlpha)  
      java.awt.image.ColorModel deriveColorModel​(java.awt.image.ColorModel colorModel, java.awt.color.ColorSpace cs, boolean forceNoAlpha)  
      java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi, java.awt.color.ColorSpace cs)  
      java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi, java.awt.color.ICC_Profile profile)  
      java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi, java.awt.image.ColorModel cm)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ColorTools

        public ColorTools()
    • Method Detail

      • correctImage

        public java.awt.image.BufferedImage correctImage​(java.awt.image.BufferedImage src,
                                                         java.io.File file)
                                                  throws ImageReadException,
                                                         java.io.IOException
        Throws:
        ImageReadException
        java.io.IOException
      • relabelColorSpace

        public java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi,
                                                              java.awt.color.ICC_Profile profile)
                                                       throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • relabelColorSpace

        public java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi,
                                                              java.awt.color.ColorSpace cs)
                                                       throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • relabelColorSpace

        public java.awt.image.BufferedImage relabelColorSpace​(java.awt.image.BufferedImage bi,
                                                              java.awt.image.ColorModel cm)
                                                       throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • deriveColorModel

        public java.awt.image.ColorModel deriveColorModel​(java.awt.image.BufferedImage bi,
                                                          java.awt.color.ColorSpace cs)
                                                   throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • deriveColorModel

        public java.awt.image.ColorModel deriveColorModel​(java.awt.image.BufferedImage bi,
                                                          java.awt.color.ColorSpace cs,
                                                          boolean forceNoAlpha)
                                                   throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • deriveColorModel

        public java.awt.image.ColorModel deriveColorModel​(java.awt.image.ColorModel colorModel,
                                                          java.awt.color.ColorSpace cs,
                                                          boolean forceNoAlpha)
                                                   throws java.awt.image.ImagingOpException
        Throws:
        java.awt.image.ImagingOpException
      • convertToColorSpace

        public java.awt.image.BufferedImage convertToColorSpace​(java.awt.image.BufferedImage bi,
                                                                java.awt.color.ColorSpace to)
      • convertTosRGB

        public java.awt.image.BufferedImage convertTosRGB​(java.awt.image.BufferedImage bi)
      • convertBetweenICCProfiles

        public java.awt.image.BufferedImage convertBetweenICCProfiles​(java.awt.image.BufferedImage bi,
                                                                      java.awt.color.ICC_Profile from,
                                                                      java.awt.color.ICC_Profile to)
      • convertToICCProfile

        public java.awt.image.BufferedImage convertToICCProfile​(java.awt.image.BufferedImage bi,
                                                                java.awt.color.ICC_Profile to)
      • convertBetweenColorSpacesX2

        public java.awt.image.BufferedImage convertBetweenColorSpacesX2​(java.awt.image.BufferedImage bi,
                                                                        java.awt.color.ColorSpace from,
                                                                        java.awt.color.ColorSpace to)
      • convertBetweenColorSpaces

        public java.awt.image.BufferedImage convertBetweenColorSpaces​(java.awt.image.BufferedImage bi,
                                                                      java.awt.color.ColorSpace from,
                                                                      java.awt.color.ColorSpace to)