imaging

A fast, dependency-light Go library for resizing, cropping, rotating, and adjusting images with zero cgo requirements.

Library
Go
vv1.6.2
5,757stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
46/100Fair
Development Activity0
Maintenance20
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
66/100Good
Architecture78
Code Quality65
Innovation55
Learning Curve65

Imaging is a pure-Go image processing package that wraps the standard library’s image.Image interface with a consistent, chainable API for resizing, cropping, rotating, blurring, sharpening, and color-adjusting images. Every operation accepts any type implementing image.Image and returns a uniform *image.NRGBA result, so transforms can be composed directly without manual type conversions.

Under the hood it favors direct scanline access over per-pixel interface calls and parallelizes every transform’s inner loop across available CPU cores, giving predictable performance without configuration. Because it has no cgo dependency, it’s a common choice for services that need image manipulation in statically-linked, cross-compiled Go binaries.

What You Get

  • A unified *image.NRGBA output type across every transform, so operations chain without manual conversions
  • Multiple resampling filters (Lanczos, CatmullRom, MitchellNetravali, Linear, Box, NearestNeighbor, and more) selectable per resize call
  • Built-in EXIF orientation auto-correction on decode via imaging.Open(path, imaging.AutoOrientation(true))
  • Automatic multi-core parallelism in every transform, with an optional SetMaxProcs cap
  • Encode/decode support for JPEG, PNG, GIF, TIFF, and BMP out of the box

Common Use Cases

  • Generating thumbnails for uploaded user avatars or product photos
  • Server-side image resizing pipelines for CDN or static-site asset generation
  • Auto-correcting phone-camera photo orientation before display
  • Applying blur/sharpen/grayscale effects for image previews or watermarking

Under The Hood

Architecture The package is organized as a flat, single-namespace Go package (no internal/ or cmd/ subdirectories) where each file groups one processing concern - io.go (Decode/Open/Encode/Save plus EXIF orientation detection via a hand-rolled JPEG APP1/EXIF binary reader), resize.go (Resize/Fit/Fill/Thumbnail with precomputed per-axis weight tables in precomputeWeights), transform.go (flips/rotations/arbitrary-angle Rotate with bilinear interpolatePoint), effects.go (separable horizontal/vertical Gaussian Blur and unsharp-mask Sharpen), adjust.go (per-pixel Grayscale/Invert/AdjustContrast/AdjustBrightness/AdjustSaturation/AdjustHue via HSL conversion in utils.go), convolution.go (generic 3x3/5x5 kernel convolution), and tools.go (New/Clone/Crop/CropAnchor/Paste/Overlay compositing). All pixel access is funneled through a single scanner abstraction (scanner.go) that type-switches on the concrete image.Image implementation to read scanlines directly into a shared NRGBA byte buffer, avoiding the per-pixel At()/Set() interface-dispatch overhead the standard library normally incurs. Every transform’s inner loop runs through a shared parallel() helper in utils.go that partitions rows/columns across goroutines bounded by GOMAXPROCS (or a caller-set SetMaxProcs cap). There is no dependency injection or layering - this is a stateless, pure-function library where the same *image.NRGBA return type threads consistently through every op, letting calls chain (Resize -> Blur -> Sharpen) without conversion.

Tech Stack Pure Go, module github.com/disintegration/imaging, with a single external dependency on golang.org/x/image (for TIFF and BMP codec support beyond the standard library’s JPEG/PNG/GIF). There is no web framework, ORM, or database involved - this is a library, not a service. CI (via Travis) runs against several Go versions across amd64 and ppc64le architectures, executing the test suite with the race detector and coverage enabled. Deployment is simply go get, since consumers import the package directly.

Code Quality Every source file has a matching _test.go counterpart, totaling dozens of table-driven test functions using only the standard library testing package, plus a runnable godoc Example() for documentation verification. CI runs with the race detector enabled, exercising the goroutine-based parallel() paths for data races. Error handling is minimal by design - pure transform functions return values, not errors, and the small I/O surface (Decode/Open/Save) returns plain Go errors without wrapping or typed error values. No linter configuration is present in the repo; naming follows idiomatic Go conventions with doc comments on every exported symbol.

What Makes It Unique The innovation here is engineering discipline rather than novel algorithms: a scanner abstraction that type-switches to avoid interface overhead per pixel, precomputed weight tables for resampling filters to avoid repeated kernel evaluation, and a consistent *image.NRGBA return contract that lets operations chain cleanly. Compared to cgo-based bindings around native imaging libraries, this package trades some raw throughput for a pure-Go, no-cgo footprint that’s straightforward to cross-compile into static binaries - a meaningful tradeoff for services and CLIs that need portable, dependency-light image processing rather than the broadest possible feature set.

Used by 8 apps in this directory

Go
60%
Apache 2.0

Apache Answer

Community

15,658

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
84
Repo Health
78
Technical
68
Dependency
Built with
Go60%
TypeScript36%
Updated 2 days ago
Go
90%
Apache 2.0

CasaOS

Hosting Control Panel · File Storage

37,163

Your simple, elegant personal cloud OS for home data and apps

View details
51
Repo Health
71
Technical
65
Dependency
Built with
Go90%
Updated 1 years ago
Go
98%
Other

Crush

Developer Tools · AI Code Assistants · AI Assistants

27,798

Your terminal coding companion — wire up any LLM with LSP intelligence, MCP extensibility, and a skills system that learns your workflow.

View details
87
Repo Health
86
Technical
69
Dependency
Built with
Go98%
Updated today
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,373

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
70
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 1 weeks ago
Go
41%
AGPL 3.0

listmonk

Marketing · Blogging

23,177

High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.

View details
86
Repo Health
74
Technical
68
Dependency
Built with
Go41%
Vue24%
JavaScript19%
Updated 5 days ago
Go
53%
MIT

memos

Note Taking

62,642

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
66
Dependency
Built with
Go53%
TypeScript46%
Updated today
Go
69%
MIT

PocketBase

Databases · Ecommerce · Authentication

60,884

Open Source realtime backend in 1 file — embedded SQLite, auth, file storage, and admin UI as a single Go binary.

View details
89
Repo Health
87
Technical
77
Dependency
Built with
Go69%
JavaScript25%
Updated 2 days ago
Go
73%
AGPL 3.0

Vikunja

Project Management

5,206

Self-hosted task management with natural-language quick-add, multiple views, and a fully documented REST API — your tasks, your infrastructure, zero lock-in.

View details
86
Repo Health
81
Technical
74
Dependency
Built with
Go73%
TypeScript14%
Vue12%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search