mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 00:02:37 +02:00
use pixel filter
This commit is contained in:
parent
0f3d55279e
commit
dbb93e2f73
@ -20,6 +20,7 @@ func NewGift(options *ImageOptions) *gift.GIFT {
|
||||
}
|
||||
g.Add(
|
||||
gift.ResizeToFit(options.ViewWidth, options.ViewHeight, gift.LanczosResampling),
|
||||
filters.Pixel(),
|
||||
)
|
||||
return g
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user