Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuPath's viewer does not support ICC profiles #982

Open
petebankhead opened this issue Jun 1, 2022 · 2 comments
Open

QuPath's viewer does not support ICC profiles #982

petebankhead opened this issue Jun 1, 2022 · 2 comments
Assignees
Milestone

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
QuPath's viewer doesn't (really) support ICC profiles.

This makes the display colors inconsistent with that seen in other viewers, for some file formats.

To Reproduce
Steps to reproduce the behavior:

  1. Open an SVS image in QuPath
  2. Compare with the same SVS image opened in ImageScope (with ICC profile turned on)

Expected behavior
QuPath would ideally provide an option to view the image with the ICC profile applied.

This should only affect the viewer; analysis itself should not be impacted.

However, it may be worth considering whether to add an ImageServer implementation that applies an ICC profile as well, since this might potentially be used as a way to do color standardisation (relevant e.g. for deep learning).
If this is done, then the information must be accessible to the viewer so that any embedded ICC profile isn't applied twice.

Screenshots
See https://forum.image.sc/t/color-discrepancy-qupath-x-imagescope-leica-gt450/57948

Desktop (please complete the following information):

  • OS: All
  • QuPath Version: all until v0.3.2 (current)

Additional context
For further discussion, see https://forum.image.sc/t/color-discrepancy-qupath-x-imagescope-leica-gt450/57948

There is some experimental (and hidden) support for ICC profiles accessible in QuPath via scripting, e.g. see https://github.com/qupath/qupath/blob/main/qupath-gui-fx/src/main/java/qupath/lib/gui/viewer/QuPathViewer.java#L2178
However, performance is really poor and it is not really usable at this time.

Any implementation should be considered alongside gamma adjustment, see #981

@petebankhead
Copy link
Member Author

Looked into this and it seems a bit of a minefield with no really quick solution.

More info at https://github.com/petebankhead/ICC-Profiles

@petebankhead
Copy link
Member Author

New discussion at https://forum.image.sc/t/openslide-4-0-is-coming-rsn-new-features-relevant-to-qupath/86015

Here's an initial proposal for the work involved in adding preliminary support:

  • Static methods in BufferedImageTools to read ICC Profiles from TIFF images & byte arrays
  • JSON-serializable interface for a color conversion (name, type, URIs, convertTosRGB method)
    • ICC Profile implementation that is basically a wrapper handle applying an ICC Profile to convert to sRGB, caching any required ColorConvertOp
  • Retrofit ImageServer with a method to get a color conversion object (defaults to null), and return a flag to state whether the conversion has been applied when returning pixels (i.e. it's a property within the server itself - one can't ask for converted and unconverted pixels from the same server)
  • Support applying any conversion 'live' within the viewer (caching tiles as needed)
  • Support for applying any conversion at the point the image is being read via project import flags

@petebankhead petebankhead self-assigned this Sep 11, 2023
@petebankhead petebankhead added this to the v0.5.0 milestone Sep 11, 2023
@petebankhead petebankhead modified the milestones: v0.5.0-rc1, v0.6.0 Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant