Documentation
¶
Index ¶
- Variables
- func ClampQuality(q int) int
- func ColorsForQuality(quality int) int
- func Encode(img image.Image, format Format, quality int) ([]byte, error)
- func HumanBytes(n int) string
- func ParseBytes(s string) (int, error)
- func ParseScale(s string) (float64, error)
- func Quantize(img image.Image, n int) color.Palette
- func Resample(src image.Image, w, h int) image.Image
- func Saving(before, after int) float64
- func TargetDimensions(w, h int, scale float64, maxW, maxH int) (int, int)
- type Format
- type Options
- type Result
- type Source
- type Step
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLadder = []int{95, 90, 85, 80, 75, 65, 55, 40}
View Source
var MaxPixels = 50_000_000
MaxPixels bounds how large an image may be before it is even decoded. A small file can declare enormous dimensions — a few KB of PNG can claim 100000x100000 and decode to hundreds of gigabytes of RGBA — so the header is checked before any pixels are allocated. 50 megapixels clears any real camera; raise it if you genuinely need to.
Functions ¶
func ClampQuality ¶
func ColorsForQuality ¶
func HumanBytes ¶
func ParseBytes ¶
func ParseScale ¶
Types ¶
type Format ¶
type Format int
func EncodableFormats ¶
func EncodableFormats() []Format
func ParseFormat ¶
func ResolveOutputFormat ¶
Click to show internal directories.
Click to hide internal directories.