https://github.com/drew138/go-graphics
go package with various utilities for image processing and generation
https://github.com/drew138/go-graphics
image-processing image-transformations
Last synced: over 1 year ago
JSON representation
go package with various utilities for image processing and generation
- Host: GitHub
- URL: https://github.com/drew138/go-graphics
- Owner: drew138
- License: apache-2.0
- Created: 2021-03-17T01:23:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-31T18:13:18.000Z (over 4 years ago)
- Last Synced: 2025-01-23T19:24:30.891Z (over 1 year ago)
- Topics: image-processing, image-transformations
- Language: Go
- Homepage:
- Size: 2.92 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GO GRAPHICS
## Image Processing
The processing package provides the function `TransformImage` which takes an `Image`, and `Kernel` structs as parameters and returns a pointer to `RGBA` struct.
TransformImage Type Declaration
```
func TransformImage(i image.Image, k *kernels.Kernel) *image.RGBA
```
`Image` and `RGBA` structs are provided by the `image` package from the standard library. `Kernel` on the other hand is supplied by the kernel package of this library.
## Supported Formats
Three formats are supported by the processing package (png, jpeg and jpg). The formats package supplies the function `IsSupportedFormat` which takes a string and returns a boolean value.
## Kernels
Four basic kernels are provided by the kernel package:
#### Example Transformations
### Original Image

### Sharpen Kernel

### GaussianBlur Kernel

### EdgeDetection Kernel
When applied on an image transformation, the resulting image displays the edges of objects in the image.

### BoxBlur Kernel

### Custom Kernel
A custom kernel can be used by implementing the Kernel struct from the kernels package. This struct contains the field Kernel which is a three by three matrix of float32 values.