mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-04-27 11:09:09 -04:00
31 lines
537 B
Python
Executable File
31 lines
537 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
__author__='bt3gl'
|
|
'''
|
|
Compare two aligned images of the same size.
|
|
|
|
Usage: python compare.py first-image second-image
|
|
'''
|
|
|
|
import sys
|
|
|
|
from scipy.misc import imread, imsave
|
|
|
|
|
|
def compare_images(img1, img2):
|
|
diff = img1 + img2
|
|
imsave('sum.png', diff)
|
|
diff = img1 - img2
|
|
imsave('diff.png', diff)
|
|
|
|
|
|
|
|
def main():
|
|
file1, file2 = sys.argv[1:1+2]
|
|
img1 = imread(file1).astype(float)
|
|
img2 = imread(file2).astype(float)
|
|
compare_images(img1, img2)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|