Versions in this module Expand all Collapse all v0 v0.0.1 Nov 5, 2023 Changes in this version + const ActionCrop + const ActionFill + const ActionFit + const ActionResize + func AddColorToPalette(c color.Color, p color.Palette) color.Palette + func ColorToHexString(c color.Color) string + func DecodeConfig(in map[string]any) (*config.ConfigNamespace[ImagingConfig, ImagingConfigInternal], error) + func IsOpaque(img image.Image) bool + func ReplaceColorInPalette(c color.Color, p color.Palette) + func ToFilters(in any) []gift.Filter + func UnwrapFilter(in gift.Filter) gift.Filter + type ExifConfig struct + DisableDate bool + DisableLatLong bool + ExcludeFields string + IncludeFields string + type Filters struct + func (*Filters) Brightness(percentage any) gift.Filter + func (*Filters) ColorBalance(percentageRed, percentageGreen, percentageBlue any) gift.Filter + func (*Filters) Colorize(hue, saturation, percentage any) gift.Filter + func (*Filters) Contrast(percentage any) gift.Filter + func (*Filters) Gamma(gamma any) gift.Filter + func (*Filters) GaussianBlur(sigma any) gift.Filter + func (*Filters) Grayscale() gift.Filter + func (*Filters) Hue(shift any) gift.Filter + func (*Filters) Invert() gift.Filter + func (*Filters) Opacity(opacity any) gift.Filter + func (*Filters) Overlay(src ImageSource, x, y any) gift.Filter + func (*Filters) Padding(args ...any) gift.Filter + func (*Filters) Pixelate(size any) gift.Filter + func (*Filters) Process(spec any) gift.Filter + func (*Filters) Saturation(percentage any) gift.Filter + func (*Filters) Sepia(percentage any) gift.Filter + func (*Filters) Sigmoid(midpoint, factor any) gift.Filter + func (*Filters) Text(text string, options ...any) gift.Filter + func (*Filters) UnsharpMask(sigma, amount, threshold any) gift.Filter + type Format int + const BMP + const GIF + const JPEG + const PNG + const TIFF + const WEBP + func ImageFormatFromExt(ext string) (Format, bool) + func ImageFormatFromMediaSubType(sub string) (Format, bool) + func (f Format) DefaultExtension() string + func (f Format) MediaType() media.Type + func (f Format) RequiresDefaultQuality() bool + func (f Format) SupportsTransparency() bool + type Giphy interface + GIF func() *gif.GIF + type Image struct + Format Format + Proc *ImageProcessor + Spec Spec + func NewImage(f Format, proc *ImageProcessor, img image.Image, s Spec) *Image + func (i *Image) EncodeTo(conf ImageConfig, img image.Image, w io.Writer) error + func (i *Image) Height() int + func (i *Image) InitConfig(r io.Reader) error + func (i *Image) Width() int + func (i Image) WithImage(img image.Image) *Image + func (i Image) WithSpec(s Spec) *Image + type ImageConfig struct + Action string + Anchor gift.Anchor + AnchorStr string + BgColor color.Color + BgColorStr string + Filter gift.Resampling + FilterStr string + Height int + Hint webpoptions.EncodingPreset + Key string + Quality int + Rotate int + TargetFormat Format + Width int + func DecodeImageConfig(action string, options []string, ...) (ImageConfig, error) + func GetDefaultImageConfig(action string, ...) ImageConfig + func (i ImageConfig) GetKey(format Format) string + type ImageProcessSpecProvider interface + ImageProcessSpec func() string + type ImageProcessor struct + Cfg *config.ConfigNamespace[ImagingConfig, ImagingConfigInternal] + func NewImageProcessor(cfg *config.ConfigNamespace[ImagingConfig, ImagingConfigInternal]) (*ImageProcessor, error) + func (p *ImageProcessor) ApplyFiltersFromConfig(src image.Image, conf ImageConfig) (image.Image, error) + func (p *ImageProcessor) DecodeExif(r io.Reader) (*exif.ExifInfo, error) + func (p *ImageProcessor) Filter(src image.Image, filters ...gift.Filter) (image.Image, error) + func (p *ImageProcessor) FiltersFromConfig(src image.Image, conf ImageConfig) ([]gift.Filter, error) + type ImageResource interface + type ImageResourceOps interface + Colors func() ([]string, error) + Crop func(spec string) (ImageResource, error) + DecodeImage func() (image.Image, error) + Exif func() *exif.ExifInfo + Fill func(spec string) (ImageResource, error) + Filter func(filters ...any) (ImageResource, error) + Fit func(spec string) (ImageResource, error) + Height func() int + Process func(spec string) (ImageResource, error) + Resize func(spec string) (ImageResource, error) + Width func() int + type ImageSource interface + DecodeImage func() (image.Image, error) + Key func() string + type ImagingConfig struct + Anchor string + BgColor string + Exif ExifConfig + Hint string + Quality int + ResampleFilter string + type ImagingConfigInternal struct + Anchor gift.Anchor + BgColor color.Color + Hint webpoptions.EncodingPreset + Imaging ImagingConfig + ResampleFilter gift.Resampling + func (i *ImagingConfigInternal) Compile(externalCfg *ImagingConfig) error + type Spec interface + ReadSeekCloser func() (hugio.ReadSeekCloser, error)