imagecompare

Syntax

imagecompare (imgfile1, imgfile2)

Description

Compares two images and returns difference of them in percentage. If PIL package is not installed, LdtpExecutionError exception will be thrown.

Implementation

Todo:
Return values:
difference in percentage on successful image comaprison, else LdtpExecutionError exception
Note: Script designer can decide the pass / fail criteria based on the diff percentage.

Refer: http://webcvs.freedesktop.org/ldtp/ldtp/python/ldtputils.py

Example

from ldtputils import *

imagecompare ('in.jpg', 'out.jpg') # Assuming that in.jpg and out.jpg are in current directory. File path should be absolute path.

Dependency

Python Imaging Library - http://www.pythonware.com/products/pil/

Author:
Shankar Ganesh <shagan.glare@gmail.com>

Veerapuram Varadhan <v.varadhan@gmail.com>



Linux Desktop Testing Project