Skip to main content

Visual Compare

Installation

pip install visual-compare

Examples

Compare images

from visual_compare.doc.visual import Visual

def get_path(filename):
    image_base = '../../files/images/'
    return image_base + filename

reference_image = get_path('123.png')
test_image = get_path('124.png')
vt = Visual()
is_diff, res = vt.compare_images(reference_image, test_image)
print(res)
assert is_diff is True

Result as follows

1.jpg

Compare images with mask

from visual_compare.doc.visual import Visual

def get_path(filename):
    image_base = '../../files/images/'
    return image_base + filename

reference_image = get_path('123.png')
test_image = get_path('124.png')
mask_images = [get_path('000.png')]
vt = Visual()
mask = vt.generate_mask(reference_image, mask_images)
is_diff, res = vt.compare_images(reference_image, test_image, mask=mask)
print(res)
assert is_diff is True

Result as follows

2.jpg

Compare images with OCR

from visual_compare.doc.visual import Visual

def get_path(filename):
    image_base = '../../files/images/'
    return image_base + filename

reference_image = get_path('123.png')
test_image = get_path('124.png')
vt = Visual()
is_diff, res = vt.compare_images(reference_image, test_image, force_ocr=True, lang=['ch_sim', 'en'])
print(res)
assert is_diff is True

Result as follows

3.jpg

Metadata

Release files for visual-compare 1.0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for visual-compare 1.0.2.3
File Size Uploaded
visual-compare-1.0.2.3.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for visual-compare 1.0.2.3
File Interpreter ABI Platform
visual_compare-1.0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 70.2 kB

Release files / visual-compare-1.0.2.3.tar.gz

Download URL visual-compare-1.0.2.3.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dc7c4ef8c8f4d3d6657498507f161f0fb24d956f8f379673e13a679c042ddafd
BLAKE2b-256 checksum
How to use checksums
8f596b5110e33d50bacb399f2923cd3ad8761b7a478e5d4d9a760f2cd47677d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / visual_compare-1.0.2.3-py3-none-any.whl

Download URL visual_compare-1.0.2.3-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de6366dcb0cba30779eba1e57153f2d7534cae02a38a3a5fe265eb7f0f817953
BLAKE2b-256 checksum
How to use checksums
6dde28e7ba550212a54213f658dffa1062d5f6b5acd4345afd8e5a9dd8b0915d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.0.2.3 This release

2 release files

1.0.2.2

1 release file

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page