read text color from image

prakash jp prakash.stack at gmail.com
Wed Jan 12 05:27:12 EST 2011


Hi All,

During automation of a test case the web interface throws failure and sucess
text in RED and GREEN colors respectively. Is there a method to read the
color of the Success(green) and Failure(red) from the screenshots of the
webinterfaces collect for Failure and Success

say :

import Image
import ImageChops
im2 = Image.open("Failure.JPG")
im1 = Image.open("Sucess.JPG")
#print list(im1.getdata())
diff = ImageChops.difference(im2, im1)
#print diff.getbbox()
#diff.show()
#print im1.tostring()

Thanks for all in advance

Prakash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110112/8bb251db/attachment.html>


More information about the Python-list mailing list