Skip to content

proposal: image/gif: Allow for configure diffusion strength #67050

Closed

Description

@abergmeier

Proposal Details

The current gif error diffusion is very basic and generates low contrast images.
In https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2 there is a possibility to configure Strength (affecting image contrasts) of FloydSteinberg transform (see dither.ErrorDiffusionStrength).

It would be great if at least the Strength could be added as a field to gif.Options.

Activity

  1. added this to the Proposal milestone on Apr 26, 2024
  2. moved this to Incoming in Proposalson Apr 26, 2024
  3. ianlancetaylor commented on Apr 26, 2024

    @ianlancetaylor
    Contributor
  4. nigeltao commented on Apr 28, 2024

    @nigeltao
    Contributor

    I don't see why this has to be in the standard library. Floyd-Steinberg is one of many dithering algorithms (as your https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2 shows) and part of the image/gif API design (and the existing Options.Drawer field) is that you can bring your own dithering implementations (with a Strength field or whatever else you want).

    On the other hand, anything in the standard library has to be supported forever and, once released, its API is frozen forever. There's a high bar for adding anything to the stdlib at this point.

  5. locked and limited conversation to collaborators on Apr 28, 2025
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions