diffimage

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 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

go run cmd/diff-image/main.go -h
Usage of /var/folders/_q/dpw924t12bj25568xfxcd2wm0000gn/T/go-build1976644086/b001/exe/main:
    -a, --after-image-path string
    	[required] Image path (after)
    -b, --before-image-path string
    	[required] Image path (before)
    -f, --failure-if-diff-exists
    	To be failure if diff exists.
    -h, --help
    	Show help
    -o, --output string
    	[required] Output path

go run cmd/diff-image/main.go -o=/tmp/d.png -b=/tmp/s1.png -a=/tmp/s2.png

Example

example

Build

# Build
APP=/tmp/diff-image; MAIN=cmd/diff-image/main.go; go build -ldflags="-s -w" -trimpath -o "${APP}" "${MAIN}"; chmod +x "${APP}"

# Croess compile by goreleaser
goreleaser --snapshot --skip-publish --rm-dist

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

Jump to

Keyboard shortcuts

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