impzero / go-filters

๐Ÿ“š Image filters library written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-filters ๐Ÿ–ผ๏ธ

This is a simple go project that applies different filters like grayscale or B&W to an image.

Usage

There are several filters you can apply to an image. Here is a start.

The grayscale filter using the weighted coefficients

$ go run main.go ./examples/winxp.png grayscale-coeff

The grayscale filter using the average value of the three channels ((R)ed, (G)reen and (B)lue)

$ go run main.go ./examples/winxp.png grayscale-avg

The black&white filter

$ go run main.go ./examples/winxp.png bw

Filters

  • Grayscales

    • averaging the RGB components
    • weighted sum of the RGB components Y = 0.299 * R + 0.587 * G + 0.114 * B
  • Black & White

Examples

Original image

Grayscale using the weighted sum method

Grayscale using the averaging method

Black & White filter

Resources

About

๐Ÿ“š Image filters library written in Go


Languages

Language:Go 100.0%