imgutil

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package imgutil offers some useful general functions for working with images within the dither module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToPixels

func ImageToPixels(img image.Image) *[][]color.Color

ImageToPixels converts an image.Image instance into a column-major array

More specifically, a pointer to a [][]color.Color array is returned, indexed like so: color @ (x, y) -> (*return)[x][y] where x indexes the outer slice, selecting one column, and y indexes those slices

func OpenImage

func OpenImage(path string) (image.Image, error)

OpenImage opens an image by providing a path.

func PixelsToImage

func PixelsToImage(pixels *[][]color.Color) *image.RGBA

PixelsToImage creates an image.RGBA from the given slice of color.Color slices

func SaveGIF

func SaveGIF(img image.Image, name string)

SaveGIF saves img at path as a GIF file

func SaveJPEG

func SaveJPEG(img image.Image, name string, quality int)

SaveJPEG saves img at path as a JPEG file, with specified JPEG quality

func SavePNG

func SavePNG(img image.Image, name string)

SavePNG saves img at path as a PNG file

Types

This section is empty.

Jump to

Keyboard shortcuts

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