PHash

Script to create a perceptual hash of an image (or file) stored in the incident. Wrapps https://pypi.org/project/ImageHash/

python · Community Common Scripts

Source

import demistomock as demisto  # noqa: F401
import imagehash
from CommonServerPython import *  # noqa: F401
from PIL import Image

ImageID = demisto.args()["image"]
ImageFilePath = demisto.getFilePath(ImageID)

hash = imagehash.phash(Image.open(ImageFilePath["path"]))
context = {"PHash": str(hash)}
command_results = CommandResults(outputs=context)

return_results(command_results)

README

Script to create a perceptual hash of an image (or file) stored in the incident. Wrapps https://pypi.org/project/ImageHash/

Script Data


Name Description
Script Type python3
Tags  

Inputs


Argument Name Description
image EntryID of image

Outputs


Path Description Type
phash Hash of the image string