Documentation
¶
Overview ¶
Package resize provides image resizing with various interpolation methods.
Index ¶
- func Resize(src image.Image, opts Options) image.Image
- func ResizeExact(src image.Image, width, height int) image.Image
- func ResizeFromFile(path string, opts Options) (image.Image, error)
- func ResizeToFit(src image.Image, maxWidth, maxHeight int) image.Image
- func ResizeToHeight(src image.Image, height int) image.Image
- func ResizeToWidth(src image.Image, width int) image.Image
- func SaveJPEG(img image.Image, w io.Writer, quality int) error
- func SavePNG(img image.Image, w io.Writer) error
- type Interpolation
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResizeExact ¶
ResizeExact resizes an image to exact dimensions, ignoring aspect ratio.
func ResizeFromFile ¶
ResizeFromFile reads an image file and resizes it.
func ResizeToFit ¶
ResizeToFit resizes an image to fit within the specified dimensions, maintaining aspect ratio.
func ResizeToHeight ¶
ResizeToHeight resizes an image to a specific height, maintaining aspect ratio.
func ResizeToWidth ¶
ResizeToWidth resizes an image to a specific width, maintaining aspect ratio.
Types ¶
type Interpolation ¶
type Interpolation int
Interpolation defines the resizing algorithm to use.
const ( // NearestNeighbor is fastest but lowest quality. NearestNeighbor Interpolation = iota // Bilinear provides decent quality with good performance. Bilinear // CatmullRom provides high quality results. CatmullRom )
Click to show internal directories.
Click to hide internal directories.