Pure Go image processing library (github.com/anthonynsimon/bild) with a built-in CLI. Minimal dependencies — just cobra for CLI and golang.org/x/image for BMP support.
make build # Build binary to dist/
make test # Run all tests (60s timeout, verbose)
make fmt # Format code (go fmt)
make race # Run tests with race detector
make bench # Run benchmarksCI runs make build && make test across Go 1.21–1.26 on Ubuntu and macOS. Arch differences can cause issues in floating point values, but it's generally acceptable as long as it's effectively imperceptible to the human eye.
Each image processing domain is its own importable package:
adjust/— brightness, contrast, gamma, hue, saturationblend/— 16 blending modes (multiply, overlay, screen, etc.)blur/— box and gaussian blurchannel/— RGBA channel extractionclone/— image cloning and paddingconvolution/— kernel convolution operationseffect/— grayscale, sepia, sharpen, sobel, invert, median, erode, dilate, emboss, edge detectionhistogram/— histogram analysis and visualizationimgio/— image I/O (PNG, JPEG, BMP)noise/— noise generation (uniform, binary, gaussian, perlin)paint/— flood fillsegment/— thresholdingtransform/— rotate, resize (7 resampling filters), crop, flip, translate, shear, zoom
Supporting packages: parallel/ (goroutine work splitting), fcolor/ (float64 RGBA), math/ (clamp, min/max), util/ (color conversions, comparison helpers), perlin/.
main.go→cmd.Execute()cmd/root.go— registers all subcommands viainit()cmd/helpers.go—apply()single-image pipeline,apply2()two-image pipeline, parsers, encoder resolutioncmd/<category>.go— one file per command group, mirrors the library packages
- All processing functions take
image.Imageand return*image.RGBA - Pixel-level parallelism via
parallel.Line()which splits rows across CPUs - Tests are table-driven with manual pixel data; comparison via
util.RGBAImageEqual()/util.RGBAImageApproxEqual()
- New library functions go in the appropriate domain package
- New CLI commands follow the pattern in existing
cmd/files - Update
CHANGELOG.mdandREADME.md