https://github.com/koraygocmen/image
A simple library for image operations with concurrency written in Go.
https://github.com/koraygocmen/image
go golang image image-manipulation image-processing rgb
Last synced: 4 months ago
JSON representation
A simple library for image operations with concurrency written in Go.
- Host: GitHub
- URL: https://github.com/koraygocmen/image
- Owner: KorayGocmen
- License: mit
- Created: 2018-07-06T23:02:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-11T12:46:45.000Z (about 4 years ago)
- Last Synced: 2025-02-07T11:52:08.128Z (over 1 year ago)
- Topics: go, golang, image, image-manipulation, image-processing, rgb
- Language: Go
- Homepage:
- Size: 4.5 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `image`
Package image implements a simple library for image operations. The library can work with pngs or jpgs. Same functions can be used for both of those image types.
Read more here:
http://www.koraygocmen.com/blog/writing-an-image-manipulation-library-in-go-part-1
98% Test coverage
---
#### Full Documentation:
https://godoc.org/github.com/KorayGocmen/image
```go
package main
import (
"fmt"
"log"
"github.com/koraygocmen/image"
)
func main() {
img, _ := image.New("test/test.jpg")
err1 := img.Grayscale(image.GrayscaleAverage).WriteToFile("test/grayscale_average_method.jpg")
if err1 != nil {
log.Fatal(err1)
}
err2 := img.Grayscale(image.GrayscaleDesaturation).WriteToFile("test/grayscale_saturation_method.jpg")
if err2 != nil {
log.Fatal(err2)
}
err3 := img.Grayscale(image.GrayscaleLuma).WriteToFile("test/grayscale_luma_method.jpg")
if err3 != nil {
log.Fatal(err3)
}
err4 := img.Filter("R", 2).WriteToFile("test/red_color_filtered_200_percent.jpg")
if err4 != nil {
log.Fatal(err4)
}
// Works both with pngs and jpgs.
imgPng, _ := image.New("test/test.png")
fmt.Println(imgPng.Height, imgPng.Width)
}
```
---
### License
Released under the [MIT License](https://github.com/KorayGocmen/image/blob/master/LICENSE).