explaingit

disintegration/imaging

5,719GoAudience · developerComplexity · 2/5Setup · easy

TLDR

A Go library for common image operations, resize, crop, rotate, flip, blur, and adjust color, with multiple resampling filters and support for JPEG, PNG, GIF, TIFF, and BMP, requiring no external dependencies.

Mindmap

mindmap
  root((imaging))
    What it does
      Resize images
      Crop and rotate
      Adjust colors
    Features
      Multiple resampling filters
      Auto-orientation
      Format conversion
    Tech stack
      Go standard library
      No dependencies
      pkg.go.dev docs
    Use cases
      Web app thumbnails
      Image pipelines
      Photo processing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Resize uploaded images to thumbnail dimensions in a Go web server without any external dependencies.

USE CASE 2

Crop and resize photos to fill an exact pixel area, such as generating square profile picture thumbnails.

USE CASE 3

Auto-orient JPEG photos on open so images taken with a phone camera display correctly after resizing, without manual rotation.

Tech stack

Go

Getting it running

Difficulty · easy Time to first run · 5min

Pure Go with no external dependencies, install with a single go get command.

License terms not described in the explanation, check the repository for details.

In plain English

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.

Copy-paste prompts

Prompt 1
I am building a Go image upload handler and need to resize photos to fit within 800x600 while preserving the original aspect ratio. Show me how to use the imaging.Fit function.
Prompt 2
How do I use the imaging library in Go to crop a photo to a square thumbnail and choose the Lanczos filter for sharp output?
Prompt 3
Show me how to open a JPEG in Go with imaging, auto-fix its rotation from EXIF orientation metadata, then save the result as a PNG.
Open on GitHub → Explain another repo

← disintegration on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.