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.
The pull request should fix an issue where some default java8 library, as far as I can tell, used to read in some PNGs in such a way that the alpha channel being "255" meant "transparent", but in java11 it now instead means "opaque". No doubt this confusion has to do with deep definitions of color models that can be inspected/analyzed, but that's beyond my attention span.
When MolVec reads in an image, it first flattens it to a single-channel grayscale image. To do this, it applies a certain transform if the colorspace is RGB, and a slightly different transform if it's RGBA. For the extra alpha channel, it tries to count alpha as just a multiplier to the underlying RGB transform, so an especially transparent pixel gets multiplied by 0, and an especially opaque pixel gets multiplied by 1. The alpha scale is now inverted for many images when run on a java11+ JRE, so this effectively ends up producing completely blank images since everything is viewed as transparent.
There are 4 fixes to help with this:
None of these are "perfect" fixes. A safer thing to do is probably render any image with an alpha channel on both a white and black background first using standard abstraction layers, and then use the image which maintains the highest dynamic range. But the above fixes do make the tests work for both java8 and java11, so it seems sufficient for now.