Documentation ¶
Index ¶
- Constants
- func Dehydrate(gifImage *gif.GIF) (string, error)
- func DehydratedSizePrefix(x, y int) string
- func FindOptimalSampling(imageSources []string) (int, int, error)
- func GIFImage(img image.Image, plt color.Palette, sample int) *gif.GIF
- func Hydrate(dehydrated string) string
- func StdPalette() color.Palette
- func StdPalettePrefix(width, height int) string
Constants ¶
View Source
const ( MIMETypeBase64Prefix = "data:image/gif;base64," GIF89aBase64Header = "R0lGODlh" // GIF89a )
View Source
const DefaultSampling = 16
View Source
const StdPaletteBase64Content = "qKioqKlQqKn4qKqgqKtIqKvwqVCoqVFQqVH4qVKgqVNIqVPwqfioqflQqfn4qfqg" +
"qftIqfvwqqCoqqFQqqH4qqKgqqNIqqPwq0ioq0lQq0n4q0qgq0tIq0vwq/Coq/FQ" +
"q/H4q/Kgq/NIq/PxUKipUKlRUKn5UKqhUKtJUKvxUVCpUVFRUVH5UVKhUVNJUVPx" +
"UfipUflRUfn5UfqhUftJUfvxUqCpUqFRUqH5UqKhUqNJUqPxU0ipU0lRU0n5U0qh" +
"U0tJU0vxU/CpU/FRU/H5U/KhU/NJU/Px+Kip+KlR+Kn5+Kqh+KtJ+Kvx+VCp+VFR" +
"+VH5+VKh+VNJ+VPx+fip+flR+fn5+fqh+ftJ+fvx+qCp+qFR+qH5+qKh+qNJ+qPx" +
"+0ip+0lR+0n5+0qh+0tJ+0vx+/Cp+/FR+/H5+/Kh+/NJ+/PyoKiqoKlSoKn6oKqi" +
"oKtKoKvyoVCqoVFSoVH6oVKioVNKoVPyofiqoflSofn6ofqioftKofvyoqCqoqFS" +
"oqH6oqKioqNKoqPyo0iqo0lSo0n6o0qio0tKo0vyo/Cqo/FSo/H6o/Kio/NKo/Pz" +
"SKirSKlTSKn7SKqjSKtLSKvzSVCrSVFTSVH7SVKjSVNLSVPzSfirSflTSfn7Sfqj" +
"SftLSfvzSqCrSqFTSqH7SqKjSqNLSqPzS0irS0lTS0n7S0qjS0tLS0vzS/CrS/FT" +
"S/H7S/KjS/NLS/Pz8Kir8KlT8Kn78Kqj8KtL8Kvz8VCr8VFT8VH78VKj8VNL8VPz" +
"8fir8flT8fn78fqj8ftL8fvz8qCr8qFT8qH78qKj8qNL8qPz80ir80lT80n780qj" +
"80tL80vz8/Cr8/FT8/H78/Kj8/NL8/PwAAAAAAP8A/wAA////AAD/AP///wD///9" +
"sbGxsbJZsbMBslmxslpZslsBswGxswJZswMCWbGyWbJaWbMCWlmyWlpaWlsCWwGy" +
"WwJaWwMDAbGzAbJbAbMDAlmzAlpbAlsDAwGzAwJbAwMAAAAAAAAAAAAAAAAAAAAA"
Variables ¶
This section is empty.
Functions ¶
func Dehydrate ¶
Dehydrate encodes a GIF image (base64 encoding), removes a reproducible portion (about 1Kb of content) and prefixes the result with image width and height (separated with base64 padding character)
func DehydratedSizePrefix ¶ added in v0.1.3
func FindOptimalSampling ¶ added in v0.1.4
func GIFImage ¶
GIFImage converts a given image to a standard palette (see StdPalette) image, that is sampled every `sample` pixels (e.g. every 16 pixels by default)
func Hydrate ¶
Hydrate takes dehydrated string, restores it and prefixes with base64 GIF image MIME type
func StdPalette ¶
func StdPalettePrefix ¶ added in v0.1.3
StdPalettePrefix is a reproducible portion of base64 encoded GIF image with a standard palette that contains GIF89a format header, logical screen descriptor, image descriptor, and standard palette
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.