Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultDecoder ¶
type DefaultDecoder struct { }
type JPEGDecoder ¶
type JPEGDecoder struct { }
type PNGCombiner ¶
type PNGCombiner struct {
// contains filtered or unexported fields
}
func NewPNGCombiner ¶
func NewPNGCombiner(opts ...PNGCombinerOption) *PNGCombiner
func (*PNGCombiner) AdjustImageOpacity ¶ added in v0.1.0
func (pc *PNGCombiner) AdjustImageOpacity(img Image, opacity float64) Image
Adjusts the image opacity of non-transparent pixels to the specified opacity The opacity adjustment is made using he over-composition mode of the Porter-Duff algorithm. Using over-composition since this (based on observation) allows for the best result when blending foreground over background in the current use case. The other modes can be added later and this function can be refactored if needed.
func (*PNGCombiner) CombineImages ¶
func (pc *PNGCombiner) CombineImages(img1, img2 Image) Image
func (*PNGCombiner) EncodeImage ¶ added in v0.1.0
func (pc *PNGCombiner) EncodeImage(img Image) (*bytes.Buffer, error)
func (*PNGCombiner) HexChromaKeySwap ¶ added in v0.4.0
func (pc *PNGCombiner) HexChromaKeySwap(img Image, chromaKey, newColor string) (Image, error)
type PNGCombinerOption ¶
type PNGCombinerOption func(p *PNGCombiner)
func WithBestPNGCompression ¶
func WithBestPNGCompression() PNGCombinerOption
func WithBestSpeedPNGCompression ¶
func WithBestSpeedPNGCompression() PNGCombinerOption
func WithCompressionLevel ¶
func WithCompressionLevel(level png.CompressionLevel) PNGCombinerOption
func WithDefaultPNGCompression ¶
func WithDefaultPNGCompression() PNGCombinerOption
func WithNoPNGCompression ¶
func WithNoPNGCompression() PNGCombinerOption
type PNGDecoder ¶
type PNGDecoder struct { }
Click to show internal directories.
Click to hide internal directories.