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
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
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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| visual-compare-1.0.2.3.tar.gz | 31.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|