Open delta2golf opened 3 years ago
Hi @delta2golf,
interesting suggestion. I thought about this a bit and I think we could add this to tiffslide itself. Getting the color profile seems super easy:
import io
from PIL.ImageCms import ImageCmsProfile
import tiffslide
t = tiffslide.TiffSlide("/path/to/your/image.svs")
try:
icc_profile_bytes = t.ts_tifffile.pages[0].tags[34675].value
except KeyError:
raise Exception("no icc profile stored in image")
icc_profile = ImageCmsProfile(io.BytesIO(icc_profile_bytes))
Then we'd need to build the output transform and apply it in-place to the returned PIL Images.
We'd need to test how much this slow's everything down. But we could emit a warning if the user wants to apply an icc profile.
Would you be interested in contributing this as a Pull Request? If yes, I can sketch out the interface and you could work on the implementation.
Cheers, Andreas 😃
Hi, is there any update on this? Also interested in this feature 👍
Hello @tomvars
I assume there has not been any progress on color profile support so far. Contributions are always welcome ❤️ And as stated above, I'd be happy to provide some initial guidance on the implementation if needed.
Cheers, Andreas 😃
ICC profiles are now available thanks to #83 @erikogabrielsson
Will be available in the next release.
Thank you again for the hard work on this. There is a discrepancy between the colors of the images extracted and the optimal colors such as the one seen in Leica Imagescope. Are you able to incorporate ICC profile or other solution to address this color issue? This issue is similar to what I described in this post. Thank you so much! https://forum.image.sc/t/color-discrepancy-qupath-x-imagescope-leica-gt450/57948/5