原图:
图片.png修改后的图:
图片.png执行结果
图片.png源码: https://github.com/china-testing/python-api-tesing/blob/master/practices/cv/image_diff_pil.py
代码及配套图片:https://itbooks.pipipan.com/fs/18113597-326879233
参考资料
- python图像处理pillow工具作业:合并拼接搞笑图片(资深程序员)
- python库介绍-图像处理工具pillow中文文档-手册(2018 5.*)
- python测试开发项目实战-目录
- python工具书籍下载-持续更新
- python 3.7极速入门教程 - 目录
- 讨论qq群630011153 144081101
- 本文涉及的python测试开发库 谢谢点赞!
- 本文相关海量书籍下载
- http://www.effbot.org/imagingbook/imagechops.htm
- http://www.blog.pythonlibrary.org/2016/10/11/how-to-create-a-diff-of-an-image-in-python/#more-5939
- https://stackoverflow.com/questions/16720594/comparing-two-images-pixel-wise-with-pil-python-imaging-library
- http://effbot.org/zone/pil-comparing-images.htm
- http://www.blog.pythonlibrary.org/2016/10/11/how-to-create-a-diff-of-an-image-in-python/
- https://stackoverflow.com/questions/32513311/definition-of-imagechops-difference
- https://stackoverflow.com/questions/189943/how-can-i-quantify-difference-between-two-images
后记
这个例子能快速直观地比较出图像差异,但是在虚化的比较测试中,差异的地方比较多,我们只关注差异比较大的地方,此时用opencv会更好。可以参考下代码:https://github.com/china-testing/python-api-tesing/blob/master/practices/cv/image_diff.py
网友评论