Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
abergmeier opened this issue Apr 26, 2024 · 2 comments
Closed

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

abergmeier opened this issue Apr 26, 2024 · 2 comments
Labels
Milestone

Comments

@abergmeier
Copy link

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.

@gopherbot gopherbot added this to the Proposal milestone Apr 26, 2024
@ianlancetaylor
Copy link
Contributor

CC @nigeltao

@nigeltao
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants