Help us shape the future of Go! Take the 2026 Go Developer Survey

diffimage

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 8 Imported by: 0

README

go-diff-image

A diff tool for images.

Installation

$ go get github.com/xshoji/go-diff-image

Usage

$ ./diff-image -h
Usage: ./diff-image [OPTIONS] [-h, --help]

Description:
  A diff tool for images.

Options:
  -a, --after-image-path string     (REQ) Image path (after)
  -b, --before-image-path string    (REQ) Image path (before)
  -o, --output string               (REQ) Output path of difference image
  -e, --error-if-difference         Be regarded as an error (status code 1) if difference exists"
  -n, --not-output-if-same          Not output difference image if inputs are same

./diff-image -o=/tmp/d.png -b=/tmp/s1.png -a=/tmp/s2.png

Example

example

Build

# Build
$ GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o /tmp/diff-image cmd/diff-image/main.go

# Croess compile by goreleaser
#   goreleaser --version
#   GitVersion:    2.5.0
goreleaser build --snapshot --clean

Release

Release flow of this repository is integrated with github action. Git tag pushing triggers release job.

# Release
git tag v0.0.2 && git push --tags



# Delete tag
echo "v0.0.1" |xargs -I{} bash -c "git tag -d {} && git push origin :{}"

# Delete tag and recreate new tag and push
echo "v0.0.1" |xargs -I{} bash -c "git tag -d {} && git push origin :{}; git tag {} -m \"Release beta version.\"; git push --tags"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffImage

func DiffImage(img1, img2 image.Image) (diffImg *image.RGBA, deletions int, insertions int, equals int)

Types

type HashLines

type HashLines struct {
	Lines []string
}

Directories

Path Synopsis
cmd
diff-image command

Jump to

Keyboard shortcuts

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