ICC Color Profile Correction: Harmonizing Color Spaces with HistomicsTK

Microscoptic cells featuring color conversion from upper left to bottom right.
Microscoptic cells which shows color correction from top left to bottom right.
Figure 1: Before (top left) and After (lower right) color correction view of WSI

HistomicsTK is a comprehensive enterprise solution designed to streamline the management, visualization, and analysis of digital pathology data. Leveraging the robust capabilities of a Python-based data science software stack, HistomicsTK is compatible with a vast array of whole-slide imaging formats, enabling users to generate and visualize millions of annotations with ease. Our team is dedicated to the ongoing enhancement of HistomicsTK; as a result, we recently introduced ICC perceptual correction as the new default setting in version 1.20.0 of the Histomics large_image library (refer to Figure 1). Users of Histomics can now choose options amongst various intents, as shown in Figure 2.

Uncorrected image of microscoptic cell tissue


Perceptual / Saturation conversion of miscrscoptic tissue

Perceptual / Saturation

Absolute Colorimetric conversion of microscoptic tissue

Absolute Colorimetic

Relative Colorimetric conversion of miscroscoptic tissue

Relative Colorimetric

Figure 2: Different conversion intent applied to WSI in HistomicsTK

This improvement is particularly significant in light of the rapid technological advancements that continually introduce new devices for perceiving or rendering colors. Each device—be it a screen, printer, or scanner—possesses a unique gamut (see Figure 3), which represents the range of colors it can perceive or render. Moreover, devices may be equipped with non-linear sensors or emitters, which can influence their color response. To ensure consistency across devices, color spaces have been standardized. The sRGB color space is the official standard for web display, but modern monitors can often have a larger gamut. Calibrated displays and special tuning tools exist to address this, but calibration is only helpful if images are adjusted based on their recorded gamut.

Graph of a color gamut

This is where ICC profiles come into play. The International Color Consortium (ICC) Profile defines a format for expressing colorspace, ensuring good adherence to the standard. However, conversion between color spaces isn’t just a matrix transform. Transforms go through a perceptual space, which is where ICC color profile correction comes into play. Four conversion intents are available: Perceptual, Absolute Colorimetric, Relative Colorimetric, and Saturation. Perceptual is intended for images where hue is maintained, but lightness and saturation are sacrificed to maintain the perceived color. Absolute Colorimetric and Relative Colorimetric maintain hue, lightness, and saturation within the destination gamut. The only difference is that Relative Colorimetric changes the white point to result in neutral grays. Saturation maintains hue and saturation but sacrifices lightness to maintain saturation, intended for business graphics.

ICC color profile correction is vital to ensuring the accuracy and effectiveness of tuning or training algorithms. By properly correcting color, the algorithms become more robust and reliable, as variations between imaging hardware is functionally reduced. When color profiles are not adequately corrected, discrepancies become easily noticeable, leading to potential inaccuracies in the algorithms’ performance. If color correction is not applied, data must be substantially augmented or from a wider array of sources to get the same performance.

Although it may be tempting to forgo color profile correction and rely on a user’s web browser or operating system to apply the correction visually, this approach has several drawbacks. First, it can increase the data transfer load when viewing images, as the necessary profiles must be transmitted per image, consuming more bandwidth in the process. Secondly, machine learning (ML) and other algorithms would still receive the uncorrected data, which could negatively impact their performance and accuracy.

By opting to apply ICC color profile correction by default, both ML and other algorithms are more likely to function effectively with the current image data. Correction is currently always to sRGB, but some future style options will likely add a target profile. Histomics uses, Little-CMS, a common library for doing conversions that is standards-compliant and baked into the Python PILLOW ImageCms module.

It’s important to note that not all sources have ICC profiles embedded in them. Monitors also vary and aren’t necessarily close to sRGB, so adjusting for the output profile is crucial for correcting color for a user. Modern browsers adjust rendering based on OS-configured color correction values if an image has ICC profile information. However, injecting the profile into large_image tiles as they are transmitted may result in a loss of precision in high bit-depth sources, and using the CPU requires more processes to mitigate effects.

You can download HistomicsTK for free and experiment with this new feature. If you need help applying the ICC perceptual correction, Kitware can provide guidance and support. We can also help you tailor the software to meet your needs and project requirements. By partnering with Kitware, you can access our team of experts, enabling you to effectively leverage HistomicsTK. To learn more about this feature or explore the capabilities of HistomicsTK, please contact us.

Leave a Reply