Skip to content

image/color: Palette ignores alpha channel #9902

Closed

Description

@magical

Palette.Index, and by extension image.Paletted.Set, cannot distinguish between image.Black and image.Transparent (and in general, any fully-transparent color or partially-transparent black) because it ignores the alpha channel of the colors when searching for the closet match.

This makes it impossible to draw a black pixel onto an image.Paletted whose palette contains color.Transparent, even if it also contains color.Black (or the other way around, depending on the order of the colors in the palette).

See this example program: http://play.golang.org/p/29G2978Px7

In general, it seems like p.Convert(c) should equal c, for every color.Palette p and color.Color c in p.

Activity

  1. added this to the Go1.5Maybe milestone on Apr 10, 2015
  2. modified the milestones: Go1.5, Go1.5Maybe on May 27, 2015
  3. locked and limited conversation to collaborators on Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions