grayscale

package
Version: v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package grayscale provides function to grayscale an image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	image.Image
}

Image represents a grayscaled image.

func FromReader

func FromReader(r io.Reader) (*Image, error)

FromReader grayscales an image from original raw data (r).

Note that you need to blank import image type packages in order to be able to decode them in this function, for example:

import (
  _ "image/gif"
  _ "image/jpeg"
  _ "image/png"
)

func (*Image) At

func (g *Image) At(x, y int) color.Color

At overrides the original At with color.Gray16Model conversion applied.

func (*Image) ColorModel

func (g *Image) ColorModel() color.Model

ColorModel overrides the original ColorModel with color.Gray16Model.

func (*Image) ToJPEG

func (g *Image) ToJPEG() (*bytes.Buffer, error)

ToJPEG encodes the image to JPEG with default quality.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto