You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proposal: image/gif: Allow for configure diffusion strength #67050
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.
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.
Activity
ianlancetaylor commentedon Apr 26, 2024
CC @nigeltao
nigeltao commentedon Apr 28, 2024
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/gifAPI design (and the existingOptions.Drawerfield) is that you can bring your own dithering implementations (with aStrengthfield 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.