imagemagick-identify

Fast and efficient way to detect if two images are visually identical in Python

烈酒焚心 提交于 2021-02-07 06:32:22
问题 Given two images: image1.jpg image2.jpg What's a fast way to detect if they are visually identical in Python? For example, they may have different EXIF data which would yield different checksums, even though the image data is the same). Imagemagick has an excellent tool, "identify," that produces a visual hash of an image, but it's very processor intensive. 回答1: Using PIL/Pillow: from PIL import Image im1 = Image.open('image1.jpg') im2 = Image.open('image2.jpg') if list(im1.getdata()) == list

Fast and efficient way to detect if two images are visually identical in Python

僤鯓⒐⒋嵵緔 提交于 2021-02-07 06:32:20
问题 Given two images: image1.jpg image2.jpg What's a fast way to detect if they are visually identical in Python? For example, they may have different EXIF data which would yield different checksums, even though the image data is the same). Imagemagick has an excellent tool, "identify," that produces a visual hash of an image, but it's very processor intensive. 回答1: Using PIL/Pillow: from PIL import Image im1 = Image.open('image1.jpg') im2 = Image.open('image2.jpg') if list(im1.getdata()) == list

ImageMagick identify reports incorrect GIF frame count

廉价感情. 提交于 2019-12-11 00:14:58
问题 I'm using ImageMagick to do some stuff with GIF images. One of my steps is identify ing the number of frames in an image. I'm calling identify via node-imagemagick (and later gm) like this: identify -format '%T,%w,%h ' test.gif Most of the time I correctly get 53 space-separated values for 53 frames. But sometimes I get 47 or 50 frames for the same GIF image (that has 53 frames). How can this possibly happen? I'm running convert -coalesce -append test.gif other.gif at the same time, but it