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.