Hey,
I'm new and found no solution for my problem.
I only want a difference image, when my images are different. The only way currently for me is to start compare two times..
first with null at the end and read out the exit code... and if it is 1, I have to restart with a valid diff image.
Thanks in advance
Freddie
difference image only if the images are different
-
- Posts: 4
- Joined: 2018-08-05T05:50:09-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: difference image only if the images are different
You could run compare once, making the difference image, then delete it if you don't want it.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2018-08-05T05:50:09-07:00
- Authentication code: 1152
Re: difference image only if the images are different
Yes... that option I thought about as well... but I want to be sure that there's no smarter way ... more parameter wise
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: difference image only if the images are different
You could compare the mean and standard deviation or the image histograms or a perceptual hash as a quick test. If they are not exactly the same, then do your Imagemagick compare. This is not 100% reliable, but should work most of the time to identify identical images.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: difference image only if the images are different
IM has no options for conditionally writing an image. The command either writes, or it doesn't.Fredie20000 wrote:but I want to be sure that there's no smarter way...
If your concern is performance: comparing two images is quick, needing just one pass through the images. Writing is fairly fast provided there is no compression. Wring PNG is fairly slow.
snibgo's IM pages: im.snibgo.com