Skip to content

Instantly share code, notes, and snippets.

@ZipFile
Created November 1, 2020 09:11
Show Gist options
  • Save ZipFile/8612f315509ae4e71b80dbc64c1313f7 to your computer and use it in GitHub Desktop.
Save ZipFile/8612f315509ae4e71b80dbc64c1313f7 to your computer and use it in GitHub Desktop.
Calculate image signature in Python

Install dependencies

apt-get install libmagickwand-dev
pip install Wand

Usage

python sig.py file [file ...]
#!/usr/bin/env python
import sys
from wand.image import Image
def main():
for filename in sys.argv[1:]:
with Image(filename=filename) as img:
print(img.signature)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment