Versions in this module Expand all Collapse all v2 v2.5.4 Apr 20, 2021 Changes in this version + const DefaultFont + const MajorVersion + const MicroVersion + const MinorVersion + const Version + var ErrUnsupportedImageFormat = errors.New("unsupported image format") + var ImageTypes = map[ImageType]string + func ClearCache() + func IsTypeSupported(imageType ImageType) bool + func LoggingSettings(handler LoggingHandlerFunction, verbosity LogLevel) + func PrintCache() + func PrintObjectReport(label string) + func ReadRuntimeStats(stats *RuntimeStats) + func ReadVipsMemStats(stats *MemoryStats) + func Shutdown() + func ShutdownThread() + func Startup(config *Config) + type Align int + const AlignCenter + const AlignHigh + const AlignLow + type Angle int + const Angle0 + const Angle180 + const Angle270 + const Angle90 + func GetRotationAngleFromExif(orientation int) (Angle, bool) + type Angle45 int + const Angle45_0 + const Angle45_135 + const Angle45_180 + const Angle45_225 + const Angle45_270 + const Angle45_315 + const Angle45_45 + const Angle45_90 + type BandFormat int + const BandFormatChar + const BandFormatComplex + const BandFormatDouble + const BandFormatDpComplex + const BandFormatFloat + const BandFormatInt + const BandFormatNotSet + const BandFormatShort + const BandFormatUchar + const BandFormatUint + const BandFormatUshort + type BlendMode int + const BlendModeAdd + const BlendModeAtop + const BlendModeClear + const BlendModeColorBurn + const BlendModeColorDodge + const BlendModeDarken + const BlendModeDest + const BlendModeDestAtop + const BlendModeDestIn + const BlendModeDestOut + const BlendModeDestOver + const BlendModeDifference + const BlendModeExclusion + const BlendModeHardLight + const BlendModeIn + const BlendModeLighten + const BlendModeMultiply + const BlendModeOut + const BlendModeOver + const BlendModeOverlay + const BlendModeSaturate + const BlendModeScreen + const BlendModeSoftLight + const BlendModeSource + const BlendModeXOR + type Coding int + const CodingError + const CodingLABQ + const CodingNone + const CodingRAD + type Color struct + B uint8 + G uint8 + R uint8 + type ColorRGBA struct + A uint8 + B uint8 + G uint8 + R uint8 + type Config struct + CacheTrace bool + CollectStats bool + ConcurrencyLevel int + MaxCacheFiles int + MaxCacheMem int + MaxCacheSize int + ReportLeaks bool + type Direction int + const DirectionHorizontal + const DirectionVertical + type ExportParams struct + Compression int + Effort int + Format ImageType + Interlaced bool + Lossless bool + Quality int + StripMetadata bool + func NewDefaultExportParams() *ExportParams + func NewDefaultJPEGExportParams() *ExportParams + func NewDefaultPNGExportParams() *ExportParams + func NewDefaultWEBPExportParams() *ExportParams + type ExtendStrategy int + const ExtendBackground + const ExtendBlack + const ExtendCopy + const ExtendMirror + const ExtendRepeat + const ExtendWhite + type GifExportParams struct + func NewGifExportParams() *GifExportParams + type HeifExportParams struct + Lossless bool + Quality int + func NewHeifExportParams() *HeifExportParams + type ImageComposite struct + BlendMode BlendMode + Image *ImageRef + X int + Y int + type ImageMetadata struct + Colorspace Interpretation + Format ImageType + Height int + Orientation int + Width int + type ImageRef struct + func Black(width, height int) (*ImageRef, error) + func Identity(ushort bool) (*ImageRef, error) + func NewImageFromBuffer(buf []byte) (*ImageRef, error) + func NewImageFromFile(file string) (*ImageRef, error) + func NewImageFromReader(r io.Reader) (*ImageRef, error) + func XYZ(width, height int) (*ImageRef, error) + func (r *ImageRef) Add(addend *ImageRef) error + func (r *ImageRef) AddAlpha() error + func (r *ImageRef) Arrayjoin(in []*ImageRef) error + func (r *ImageRef) AutoRotate() error + func (r *ImageRef) Average() (float64, error) + func (r *ImageRef) BandFormat() BandFormat + func (r *ImageRef) BandJoin(images ...*ImageRef) error + func (r *ImageRef) BandJoinConst(constants []float64) error + func (r *ImageRef) Bands() int + func (r *ImageRef) Cast(format BandFormat) error + func (r *ImageRef) Close() + func (r *ImageRef) Coding() Coding + func (r *ImageRef) ColorSpace() Interpretation + func (r *ImageRef) Composite(overlay *ImageRef, mode BlendMode, x, y int) error + func (r *ImageRef) CompositeMulti(ins []*ImageComposite) error + func (r *ImageRef) Copy() (*ImageRef, error) + func (r *ImageRef) Divide(denominator *ImageRef) error + func (r *ImageRef) DrawRect(ink ColorRGBA, left int, top int, width int, height int, fill bool) error + func (r *ImageRef) Embed(left, top, width, height int, extend ExtendStrategy) error + func (r *ImageRef) Export(params *ExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportGif(params *GifExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportHeif(params *HeifExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportJpeg(params *JpegExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportNative() ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportPng(params *PngExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportTiff(params *TiffExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExportWebp(params *WebpExportParams) ([]byte, *ImageMetadata, error) + func (r *ImageRef) ExtractArea(left, top, width, height int) error + func (r *ImageRef) ExtractAreaNew(left, top, width, height int) (*ImageRef, error) + func (r *ImageRef) ExtractBand(band int, num int) error + func (r *ImageRef) Flatten(backgroundColor *Color) error + func (r *ImageRef) Flip(direction Direction) error + func (r *ImageRef) Format() ImageType + func (r *ImageRef) GaussianBlur(sigma float64) error + func (r *ImageRef) GetInt(name string) (int, error) + func (r *ImageRef) GetIntDefault(name string, def int) (int, error) + func (r *ImageRef) GetOrientation() int + func (r *ImageRef) HasAlpha() bool + func (r *ImageRef) HasICCProfile() bool + func (r *ImageRef) HasIPTC() bool + func (r *ImageRef) HasProfile() bool + func (r *ImageRef) Height() int + func (r *ImageRef) Interpretation() Interpretation + func (r *ImageRef) Invert() error + func (r *ImageRef) IsColorSpaceSupported() bool + func (r *ImageRef) Label(labelParams *LabelParams) error + func (r *ImageRef) Linear(a, b []float64) error + func (r *ImageRef) Linear1(a, b float64) error + func (r *ImageRef) Mapim(index *ImageRef) error + func (r *ImageRef) Maplut(lut *ImageRef) error + func (r *ImageRef) Metadata() *ImageMetadata + func (r *ImageRef) Modulate(brightness, saturation, hue float64) error + func (r *ImageRef) ModulateHSV(brightness, saturation float64, hue int) error + func (r *ImageRef) Multiply(multiplier *ImageRef) error + func (r *ImageRef) OffsetX() int + func (r *ImageRef) OffsetY() int + func (r *ImageRef) OptimizeICCProfile() error + func (r *ImageRef) PremultiplyAlpha() error + func (r *ImageRef) RemoveICCProfile() error + func (r *ImageRef) RemoveMetadata() error + func (r *ImageRef) RemoveOrientation() error + func (r *ImageRef) ResX() float64 + func (r *ImageRef) ResY() float64 + func (r *ImageRef) Resize(scale float64, kernel Kernel) error + func (r *ImageRef) ResizeWithVScale(hScale, vScale float64, kernel Kernel) error + func (r *ImageRef) Rotate(angle Angle) error + func (r *ImageRef) SetOrientation(orientation int) error + func (r *ImageRef) Sharpen(sigma float64, x1 float64, m2 float64) error + func (r *ImageRef) Similarity(scale float64, angle float64, backgroundColor *ColorRGBA, idx float64, ...) error + func (r *ImageRef) SmartCrop(width int, height int, interesting Interesting) error + func (r *ImageRef) Thumbnail(width, height int, crop Interesting) error + func (r *ImageRef) ToBytes() ([]byte, error) + func (r *ImageRef) ToColorSpace(interpretation Interpretation) error + func (r *ImageRef) ToImage(params *ExportParams) (image.Image, error) + func (r *ImageRef) UnpremultiplyAlpha() error + func (r *ImageRef) Width() int + func (r *ImageRef) Zoom(xFactor int, yFactor int) error + type ImageType int + const ImageTypeBMP + const ImageTypeGIF + const ImageTypeHEIF + const ImageTypeJPEG + const ImageTypeMagick + const ImageTypePDF + const ImageTypePNG + const ImageTypeSVG + const ImageTypeTIFF + const ImageTypeUnknown + const ImageTypeWEBP + func DetermineImageType(buf []byte) ImageType + func (i ImageType) FileExt() string + type Interesting int + const InterestingAll + const InterestingAttention + const InterestingCentre + const InterestingEntropy + const InterestingHigh + const InterestingLast + const InterestingLow + const InterestingNone + type Interpretation int + const InterpretationBW + const InterpretationCMC + const InterpretationCMYK + const InterpretationError + const InterpretationFourier + const InterpretationGB16 + const InterpretationGrey16 + const InterpretationHSV + const InterpretationHistogram + const InterpretationLAB + const InterpretationLABQ + const InterpretationLABS + const InterpretationLCH + const InterpretationMatrix + const InterpretationMultiband + const InterpretationRGB + const InterpretationRGB16 + const InterpretationSRGB + const InterpretationScRGB + const InterpretationXYZ + const InterpretationYXY + type JpegExportParams struct + Interlace bool + Quality int + StripMetadata bool + func NewJpegExportParams() *JpegExportParams + type Kernel int + const KernelAuto + const KernelCubic + const KernelLanczos2 + const KernelLanczos3 + const KernelLinear + const KernelMitchell + const KernelNearest + type LabelParams struct + Alignment Align + Color Color + Font string + Height Scalar + OffsetX Scalar + OffsetY Scalar + Opacity float32 + Text string + Width Scalar + type LogLevel int + const LogLevelCritical + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelMessage + const LogLevelWarning + type LoggingHandlerFunction func(messageDomain string, messageLevel LogLevel, message string) + type MemoryStats struct + Allocs int64 + Files int64 + Mem int64 + MemHigh int64 + type PngExportParams struct + Compression int + Interlace bool + StripMetadata bool + func NewPngExportParams() *PngExportParams + type PreMultiplicationState struct + type RuntimeStats struct + OperationCounts map[string]int64 + type Scalar struct + Relative bool + Value float64 + func ValueOf(value float64) Scalar + func (s *Scalar) Get(base int) float64 + func (s *Scalar) GetRounded(base int) int + func (s *Scalar) IsZero() bool + func (s *Scalar) Set(value float64) + func (s *Scalar) SetInt(value int) + func (s *Scalar) SetScale(f float64) + type TiffCompression int + const TiffCompressionDeflate + const TiffCompressionFax4 + const TiffCompressionJpeg + const TiffCompressionLzw + const TiffCompressionNone + const TiffCompressionPackbits + const TiffCompressionWebp + const TiffCompressionZstd + type TiffExportParams struct + Compression TiffCompression + Predictor TiffPredictor + Quality int + StripMetadata bool + func NewTiffExportParams() *TiffExportParams + type TiffPredictor int + const TiffPredictorFloat + const TiffPredictorHorizontal + const TiffPredictorNone + type WebpExportParams struct + Lossless bool + Quality int + ReductionEffort int + StripMetadata bool + func NewWebpExportParams() *WebpExportParams