LDTP  3.5.0
 All Pages
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.

Return values
differencein percentage on successful image comaprison, else LdtpExecutionError exception

Note: Script designer can decide the pass / fail criteria based on the diff percentage.

Refer: Linux: http://cgit.freedesktop.org/ldtp/ldtp2/tree/ldtputils/__init__.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 - Linux: http://www.pythonware.com/products/pil/

Note
Linux only feature
Author
Shankar Ganesh shaga.nosp@m.n.gl.nosp@m.are@g.nosp@m.mail.nosp@m..com
Veerapuram Varadhan v.var.nosp@m.adha.nosp@m.n@gma.nosp@m.il.c.nosp@m.om


Linux Desktop Testing Project