-
Bug
-
Resolution: Duplicate
-
P3
-
1.2.1
-
None
IndexColorModel was updated in the 1.2 release to try to find
the best color match for a color including its alpha components.
Unfortunately, a very poor heuristic was selected. The alpha is
matched as the highest priority over any color considerations.
This means that an exact color match with an alpha that differs
by one will be ignored in favor of a radically different color
that has exactly the same alpha. This would likely not meet anyone's
expectations of "closest color".
Even more importantly, in a more recent release code was added to
short-circuit the color and alpha distance tests to reduce the
number of calculations involved in choosing the closest color in
the colormap and this code introduced a bug. Now, when a "better
alpha match" is discovered, the concept of the "best color match"
is not reset so the real answer is now a hybrid of "best color
match with some overriding consideration of best alpha match" and
the exact nature of the decisions cannot be easily documented.
###@###.### 2005-03-31 21:33:30 GMT
the best color match for a color including its alpha components.
Unfortunately, a very poor heuristic was selected. The alpha is
matched as the highest priority over any color considerations.
This means that an exact color match with an alpha that differs
by one will be ignored in favor of a radically different color
that has exactly the same alpha. This would likely not meet anyone's
expectations of "closest color".
Even more importantly, in a more recent release code was added to
short-circuit the color and alpha distance tests to reduce the
number of calculations involved in choosing the closest color in
the colormap and this code introduced a bug. Now, when a "better
alpha match" is discovered, the concept of the "best color match"
is not reset so the real answer is now a hybrid of "best color
match with some overriding consideration of best alpha match" and
the exact nature of the decisions cannot be easily documented.
###@###.### 2005-03-31 21:33:30 GMT
- duplicates
-
JDK-6245321 bug in finding best color index in IndexColorModel.getDataElements()
- Resolved