TIFF and PNG import ignores embedded ICC color profile => wrong colors in non-sRGB images
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 350
- PR merge metrics
- No merged PRs in 30d
Description
Environment
(Fiji Is Just) ImageJ 2.0.0-rc-69/1.52p; Java 1.8.0_172 [64-bit]; Windows 10 10.0; 80MB of 5876MB (1%)
SCIFIO version: 0.37.3
The same issue was reported in the upstream SCIFIO issue tracker: https://github.com/scifio/scifio/issues/401)
Steps to reproduce
1) Use 3rd party software (GIMP 2.10.14) to create an sRGB image without alpha-channel, with the following ICC color profile: sRGB (with sRGB tone reproduction curve). Export with embedded ICC color profile as
a) TIFF (no compression) or
b) PNG (no compression)
1) Use 3rd party software (GIMP) to convert a copy of the image from step 1 to the Rec2020 color space and export the image in that color space with the respective Rec2020 ICC color profile (https://github.com/ellelstone/elles_icc_profiles/blob/master/profiles/Rec2020-elle-V4-rec709.icc) embedded.
1) Run FIJI/imageJ2 in modern mode, enable "use SCIFIO when opening files".
1) In FIJI/imageJ2, import the images from steps 1) and 2) using
a) "File -> Open"
b) "File -> Import... -> SCIFIO" followed by "Image -> Color -> Make composite", select "Display mode: composite", click "Ok".
c) "File -> Import... -> BioFormat". Open as hyperstack. Then continue as in step 4b)
Expected behaviour:
The info about the correct primaries and tone reproduction curve (TRC) from the embedded ICC matrix profile should be used to ensure that all test images are displayed with almost identical colors within FIJI
Actual observation
The Rec2020 image from step 2 is displayed with wrong colors. The observed colorshift can be exactly traced back: The ICC profile information is completely ignored and FIJI wrongly assumes sRGB (with sRGB TRC) as the image color space. Note: The sRGB image from step 1 is displayed with correct colors.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue in Fiji/ImageJ with SCIFIO enabled, using the sRGB and Rec2020 TIFF or PNG files with embedded ICC profiles described in the steps. Trace the SCIFIO import path and compare the handling of the embedded profile with the expected color display. Done means Rec2020 images display with colors consistent with their ICC profile rather than being treated as sRGB.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100