diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-26 18:55:00 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-26 19:44:36 +0100 |
commit | 13ea1e7c352852966f88ef119d9434bbb1ee62fa (patch) | |
tree | 3ce6910d14f3074dd2d2900cde4863a4f52ddc54 /resource/image.go | |
parent | 9f740b37cfb3278e34a5d085380ccd4d619dabff (diff) |
resource: Use Floyd-Steinberg dithering for PNGs
Fixes #4453
Diffstat (limited to 'resource/image.go')
-rw-r--r-- | resource/image.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/resource/image.go b/resource/image.go index 2529413cc..7dae99333 100644 --- a/resource/image.go +++ b/resource/image.go @@ -80,7 +80,7 @@ var ( // Add or increment if changes to an image format's processing requires // re-generation. imageFormatsVersions = map[imaging.Format]int{ - imaging.PNG: 1, // 1: Add proper palette handling + imaging.PNG: 2, // Floyd Steinberg dithering } // Increment to mark all processed images as stale. Only use when absolutely needed. @@ -266,7 +266,7 @@ func (i *Image) doWithImageConfig(action, spec string, f func(src image.Image, c // Apply the colour palette from the source if paletted, ok := src.(*image.Paletted); ok { tmp := image.NewPaletted(converted.Bounds(), paletted.Palette) - draw.Src.Draw(tmp, tmp.Bounds(), converted, converted.Bounds().Min) + draw.FloydSteinberg.Draw(tmp, tmp.Bounds(), converted, converted.Bounds().Min) converted = tmp } } |