use pixel filter

This commit is contained in:
Celogeek 2023-01-15 14:36:09 +01:00
parent 0f3d55279e
commit dbb93e2f73
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
2 changed files with 2 additions and 6 deletions

View File

@ -20,6 +20,7 @@ func NewGift(options *ImageOptions) *gift.GIFT {
}
g.Add(
gift.ResizeToFit(options.ViewWidth, options.ViewHeight, gift.LanczosResampling),
filters.Pixel(),
)
return g
}

View File

@ -144,12 +144,7 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) {
// Convert image
dst := image.NewPaletted(g.Bounds(src.Bounds()), options.Palette)
if dst.Bounds().Dx() == 0 || dst.Bounds().Dy() == 0 {
dst = image.NewPaletted(image.Rect(0, 0, 1, 1), dst.Palette)
dst.Set(0, 0, color.White)
} else {
g.Draw(dst, src)
}
g.Draw(dst, src)
imageOutput <- &Image{
img.Id,