I want to create an animated gif with go.
I need for that to compute multiple *image.Paletted.
But when I want to create it, I need p color.Palette but I don't know how to get the palette
How can I have the Palette?
I want to create an animated gif with go.
I need for that to compute multiple *image.Paletted.
But when I want to create it, I need p color.Palette but I don't know how to get the palette
How can I have the Palette?
The standard library has a own package for that: https://golang.org/pkg/image/color/palette/
At the moment there are two predefined palettes availiable: Plan9 and WebSafe
You can use the package like that:
frame := image.NewPaletted(
image.Rect(0, 0, 100, 200),
palette.WebSafe,
)