Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BufferedImage
uses an sRGBColorModel
by default. If a slide pyramid or associated image has an ICC profile, attach aColorModel
containing that profile to allBufferedImage
s produced from that image.Callers of
paintRegionARGB()
don't receive aBufferedImage
. For those users, addOpenSlide.getColorModel()
so the profile can be read separately. To simplify reading slide regions with aColorModel
, add anOpenSlide.readRegion()
method that returns aBufferedImage
.Graphics2D
's documentation suggests that it handles color management, but itsdrawImage()
method apparently does not. If we therefore manually invoke aColorConvertOp
inpaintRegion()
, theDICOM/Leica-4
test slide throws an exception:It seems that
ColorConvertOp
always uses perceptual rendering intent, not the default intent encoded in the profile. Not all profiles support perceptual rendering, which may be the cause of the exception. If we're going to automatically perform color conversion, we should do it predictably, not just when the Java CMS glue happens to do the right thing. For now, don't try to do color conversion, either inpaintRegion()
or any of the GUI code.Closes: #53