Define colorspaces for imagemagick comparison

ImageMagick 7.1.1-12 changed the default colorspaces used by the PHASH
compare function from sRGB,HCLp to xyY,HSB. This breaks the current code
for comparisons, so let's define the colorspaces ourselves.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-07-05 18:19:56 +02:00
parent dac9712240
commit a873a191b9
No known key found for this signature in database
GPG key ID: E13DFD4B47127951

View file

@ -256,7 +256,7 @@ class IMBackend(LocalBackend):
'-colorspace', 'gray', 'MIFF:-'
]
compare_cmd = self.compare_cmd + [
'-metric', 'PHASH', '-', 'null:',
'-define', 'phash:colorspaces=sRGB,HCLp', '-metric', 'PHASH', '-', 'null:',
]
log.debug('comparing images with pipeline {} | {}',
convert_cmd, compare_cmd)