Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6248951

IndexColorModel uses poor heuristics to match colors with alpha

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 6
    • 1.2.1
    • client-libs
    • None
    • 2d
    • generic
    • generic

      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

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: