This project demonstrates image processing using both sequential and asynchronous pipeline approaches in Go.
- Loads images (
loadImages) - Resizes them (
resizeImages) - Converts to grayscale (
grayScaleImages) - Saves them to disk (
saveImages) - Measures and prints execution time
go run main.goImages to parse: 4
Saved images number: 4
sequential elapsed: 215.328125ms
----------
Images to parse: 4
Saved images number: 4
async elapsed: 184.294792ms
The goal is to showcase how Go's concurrency primitives — goroutines and channels — can be used to build a performant data processing pipeline.
- Go 1.18 or higher
- Images:
image1.jpg,image2.jpg,image3.jpg,image4.jpgmust be present in the projectraw_imagesfolder - A
helperspackage with the following methods:LoadImage(path string) (image.Image, error)(*Img) Resize()(*Img) GrayScale()(*Img) SaveToFile() error
MIT