Resize uploaded images to thumbnail dimensions in a Go web server without any external dependencies.
Crop and resize photos to fill an exact pixel area, such as generating square profile picture thumbnails.
Auto-orient JPEG photos on open so images taken with a phone camera display correctly after resizing, without manual rotation.
Pure Go with no external dependencies, install with a single go get command.
Imaging is a Go library for basic image manipulation. It provides a set of functions for common operations: resizing, cropping, rotating, flipping, blurring, sharpening, and adjusting brightness, contrast, saturation, hue, and gamma. You pass it any standard Go image as input and get back a new image with the changes applied. It does not modify images in place. Resizing is the most detailed part of the package. You can resize to exact pixel dimensions, scale to fit within a bounding box while preserving the original proportions, or crop and resize to fill a target area. The library offers a range of resampling filters that trade speed for quality: NearestNeighbor is fastest and produces blocky results, while Lanczos is slower but produces sharper output better suited for photographs. The README includes comparison images showing the visual difference between filters on the same source image. The package also handles reading images from disk and writing them back. Supported formats include JPEG, PNG, GIF, TIFF, and BMP. One practical note the README flags: JPEG photos often contain rotation metadata that Go's standard image library ignores, so resized photos can appear rotated. The package provides an AutoOrientation option on open to fix this automatically. Installation is one command using Go's standard package tool. Documentation is hosted on pkg.go.dev. The library is intentionally lightweight. The same author maintains a separate package called gift for more advanced processing needs like color space conversions and chained multi-step pipelines. The project is open source and written in pure Go with no external dependencies beyond the standard library.
← disintegration on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.