Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FitSize ¶
Width and height of a w by h image scaled down to fit inside a side by side box with its aspect ratio kept and neither below one; the size unchanged and false when it already fits
func Quantize ¶
Palette image of img with at most colors opaque entries, colors held to 1 through 256, found by cutting its colour space again and again where the cut leaves the least squared error, each pixel weighted by its opacity; every pixel, clear ones included, takes the entry nearest its colour
func Resize ¶
Copy of img scaled to w by h with the filter, colours weighted by their alpha so transparent pixels never bleed into visible ones; an empty image for a size that is not positive and a clear one when img has no pixels
Types ¶
type Filter ¶
type Filter int
Resampling kernel Resize and Thumbnail scale with
const ( // Three lobe windowed sinc, the sharpest result for photos and artwork scaled either way Lanczos Filter = iota // Cubic spline with a of minus one half, a little softer than Lanczos with less ringing at hard edges CatmullRom // Nearest source pixel, keeping hard edges and exact colours for palette images and pixel art Nearest )