mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 08:12:36 +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(
|
g.Add(
|
||||||
gift.ResizeToFit(options.ViewWidth, options.ViewHeight, gift.LanczosResampling),
|
gift.ResizeToFit(options.ViewWidth, options.ViewHeight, gift.LanczosResampling),
|
||||||
|
filters.Pixel(),
|
||||||
)
|
)
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
@ -144,12 +144,7 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) {
|
|||||||
|
|
||||||
// Convert image
|
// Convert image
|
||||||
dst := image.NewPaletted(g.Bounds(src.Bounds()), options.Palette)
|
dst := image.NewPaletted(g.Bounds(src.Bounds()), options.Palette)
|
||||||
if dst.Bounds().Dx() == 0 || dst.Bounds().Dy() == 0 {
|
g.Draw(dst, src)
|
||||||
dst = image.NewPaletted(image.Rect(0, 0, 1, 1), dst.Palette)
|
|
||||||
dst.Set(0, 0, color.White)
|
|
||||||
} else {
|
|
||||||
g.Draw(dst, src)
|
|
||||||
}
|
|
||||||
|
|
||||||
imageOutput <- &Image{
|
imageOutput <- &Image{
|
||||||
img.Id,
|
img.Id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user