rgba

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: BSL-1.0 Imports: 7 Imported by: 0

README

RGBA Package

GoDoc Go Report Card

About

This package provides conversion from RGBA to grayscale. But it provides inconsistent results and is more suited as a reference implementation or for fast prototyping.

This Package is published on https://github.com/vbsw/rgba.

Copyright 2021, Vitali Baumtrok (vbsw@mailbox.org).

RGBA Package is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

RGBA Package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

References

Documentation

Overview

Package rgba provides conversion from RGBA to grayscale.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvarageFilter

func AvarageFilter(img *image.Gray, size uint)

AvarageFilter sets avarage values for each pixel in its area size*size. Avarage value of {9, 5, 16} is 10.

func FromFile

func FromFile(path string) image.Image

FromFile reads image from file and returns it.

func MedianFilter

func MedianFilter(img *image.Gray, size uint)

MedianFilter sets median values for each pixel in its area size*size. Median value in {9, 5, 17} is 9.

func MonochromeFilter

func MonochromeFilter(img *image.Gray, threshold uint8)

MonochromeFilter convertes image to black and white. Higher threshold means darker image.

func ToFile

func ToFile(path string, img image.Image) error

ToFile saves image to file. Format is recognized from extension in path. Default is PNG.

func ToGray

func ToGray(r, g, b uint8) uint8

ToGray converts values r (red), g (green) and b (blue) to a value of gray and returns it.

func ToGrayImage

func ToGrayImage(img image.Image) *image.Gray

ToGrayImage convertes image to a grayscale image and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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