ImageMagick creates different images on Windows and Linux

I need a batch process for creating mobile images and decided to use ImageMagick, but, unfortunately, one of my requirements is that the created images are the same for all OSs, as I send them back and forth between my local system (Windows) and the server (Linux). It seems, however, when I call

convert test.jpg -resize 25% test-small.jpg

the process creates different images on both machines. I know this because when I use the checksum, the values ​​are not exactly the same.

Does anyone know why this happened? And maybe somehow get around this, either using another executable file, or passing a parameter that will create the same images through the OS?

+3
source share
3 answers
  • Files have more than pixels in them. If you are going to compare images, write a checksum that works only with decoded pixel data. This will at least tell you if the images will be the same. File internals can be different due to many factors.

  • Resizing depends on float arithmetic, and you cannot expect this to be the same on all machines. Therefore, instead of using only the checksum, you can see if each pixel is within the tolerance of the linked in another file.

Take a look at these links:

+1
source

JPEG . , .

+1

" " "md5sum" , . , . , , , - (, ), .

, ImageMagick compare :

compare  image1.jpg  image2.jpg  delta.jpg

For color input images, the resulting delta.jpg willl uses image1.jpb as a light gray background and displays the differences in red. To get an image with a red + white triangle without a light gray background, use

compare  image1.jpg  image2.jpg  -compose src  delta.jpg

Examples of images of this techniq can be found here :

  • ImageMagick: "Diff" Image
    Left: Image with text   Center: Original image & strong> Right: Differences (= text) in red pixels. Only red difference pixels, identical pixels are white
0
source

All Articles