imdiff

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package imdiff renders a per-pixel highlight overlay PNG comparing a baseline image to a current image. Results are cached in-process by (sha256(baseline), sha256(current)).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Differ

type Differ struct {
	// HighlightColor is the color drawn over pixels that differ between
	// baseline and current.
	HighlightColor color.RGBA

	// FadeAlpha is how much of the current image to keep visible under
	// the highlights (0-255, where 255 = fully opaque, 64 = mostly faded).
	FadeAlpha uint8
	// contains filtered or unexported fields
}

Differ produces highlight-overlay PNGs.

func New

func New() *Differ

New returns a Differ with sensible defaults: red highlights on a faded current image.

func (*Differ) Diff

func (d *Differ) Diff(baseline, current []byte) ([]byte, error)

Diff returns a PNG showing changed pixels highlighted on a faded copy of `current`. When `baseline` is empty (added snapshot), every pixel in `current` is highlighted. When `current` is empty (deleted snapshot), every pixel in `baseline` is highlighted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL