Skip to content

IMAGING-393: Count transparent colors whose alpha is 0x80 or more - #575

Open
Marti2203 wants to merge 1 commit into
apache:masterfrom
Marti2203:palette-transparent-high-alpha
Open

Marti2203 wants to merge 1 commit into
apache:masterfrom
Marti2203:palette-transparent-high-alpha

Conversation

@Marti2203

Copy link
Copy Markdown

Fixes IMAGING-393.

PaletteFactory.countTransparentColors(BufferedImage) and countTrasparentColors(int[]) used first = -1 as "none seen yet" and tested first < 0. An ARGB value with an alpha of 0x80 or more is negative, so those colors were never counted (0 instead of 1 or 2). This tracks "seen" with a boolean.

PaletteFactoryTest.testCountTransparentColorsHighAlpha fails without the change and passes with it; PaletteFactoryTest and mvn -B -DskipTests -DskipITs pass.

This issue was found by an LLM-Enhanced Static Analysis Engine and verified manually. The patch and this description were prepared with AI assistance (Claude Code) and reviewed by me; the commit carries an Assisted-By: trailer.

countTransparentColors() and countTrasparentColors() used -1 as "no
color seen yet" and tested it with < 0, but an ARGB value with an alpha
of 0x80 or more is negative, so such colors were never counted. Track
whether a color was seen with a boolean.

Assisted-By: Claude Code:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant