diff

package module
v0.0.0-...-7138503 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 5 Imported by: 0

README

image-diff

Go Report Card

Allow you to calculate the difference between two images. Primarily for documents for now.

You give it first image, like that:

test-only-text

And second one:

test-text-number

And you get diff percent (6.25%) and visual diff:

diff

How to get and use

go get -u github.com/olegfedoseev/image-diff

And in you code:

import "github.com/olegfedoseev/image-diff"

diff, percent, err := diff.CompareFiles("test-only-text.png", "test-text-number.png")
if percent > 0.0 {
    fmt.Printf("images is different!")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFiles

func CompareFiles(src, dst string) (diff image.Image, percent float64, err error)

CompareFiles will load images from files and then compare it with CompareImages

func CompareImages

func CompareImages(src, dst image.Image) (diff image.Image, percent float64, err error)

CompareImages will check images size and pixel by pixel difference

Types

This section is empty.

Jump to

Keyboard shortcuts

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