public BufferedImage relabelColorSpace(final BufferedImage bi, final ColorSpace cs) throws ImagingOpException {
        // This does not do the conversion. It tries to relabel the
        // BufferedImage
        // with its actual (presumably correct) Colorspace.
        // use this when the image is mislabeled, presumably having been
        // wrongly assumed to be sRGB

        final ColorModel cm = deriveColorModel(bi, cs);

        return relabelColorSpace(bi, cm);

    }
A selection of tools for evaluating and manipulating color spaces, color values, etc.
<p>
The Javadoc provided in the original code gave the following notation:
</p>
<p>
TODO"This class is a mess and needs to be cleaned up."
</p>
src/main/java/org/apache/commons/imaging/ColorTools.java