imageencode

package
v0.0.0-...-710dfd8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RGB8ToImage

func RGB8ToImage(width, height int, rgb8data []byte, palette color.Palette) image.Image

RGB8ToImage converts RGB8 data with a color palette to an image.Image. It takes the width and height of the image, an RGB8 data slice, and a color palette. The function returns an image.Image created from the RGB8 data with the provided palette. The input RGB8 data is assumed to be in the sRGB color space.

Types

type JPEGEncoder

type JPEGEncoder struct{}

func NewJPEGEncoder

func NewJPEGEncoder() *JPEGEncoder

func (*JPEGEncoder) Encode

func (je *JPEGEncoder) Encode(imageData []byte, quality int) ([]byte, error)

type PNGEncoder

type PNGEncoder struct{}

func NewPNGEncoder

func NewPNGEncoder() *PNGEncoder

func (*PNGEncoder) Encode

func (pe *PNGEncoder) Encode(imageData []byte, minPosterization, minQuality, maxQuality, speed int) ([]byte, error)

type WebPEncoder

type WebPEncoder struct{}

func NewWebPEncoder

func NewWebPEncoder() *WebPEncoder

func (*WebPEncoder) Encode

func (we *WebPEncoder) Encode(imageData []byte, quality int, isLossless bool) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL