Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by niyanwen »

Hi,

I am working in industry and need to use image magick to process images. I stated using image magick last month, with image magick 6.9, it works well, then for some use case, like detect transparent image and compare image, result of 6 doesn't match result of 7, and I believe result of 7 is correct. When I switched to 7, I found the speed is much slower, which is not endurable

so either can anyone tell me if these command are supported in image magick 6?
And is there a way to increase the speed of image magick 7, it is too slow now

the command working in image magick 7 but not in 6:
1. convert transparent_image.png -format "%[fx:mean.a]" info:

2. convert -metric "AE" image1.png image2.png ---- this one is partially works....
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by snibgo »

On speed comparisons: what version are you using? Do they use HDRI?


This works for me in 6.9.9-50:

Code: Select all

convert transparent_image.png -format "%[fx:mean.a]" info:
However, the meaning of "alpha" is reversed to the norm. In this command, 0 means opaque and 1 means transparent.
snibgo's IM pages: im.snibgo.com
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by niyanwen »

for 6 we are using 6.9.4_1 ( 6.9.4_1.203308.0 )
for 7 we are using 7.x ( 7.x.200529.0 )

so is there any way to increase the speed of 7? if not we will stick with 6
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by fmw42 »

so is there any way to increase the speed of 7?
Run

Code: Select all

convert -version
for IM 6 and

Code: Select all

magick -version
for IM 7.

Show what is returned. Look to see if either show HDRI. If IM 7 does and IM 6 does not, then recompile IM 7 without HDRI support. Be sure both have the same Q Level as reported above, typically Q16. Recompile as Q8 may help.
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by niyanwen »

I have some error to check the version since my cloud desktop install IM6, and I need to check the version actually generated in bin by java
I am working on fix this, for now what I can only find is

for IM6 it shows libMagickCore-6.Q16
for IM7, islibMagickCore-7.Q16HDRI


personally I would stick with IM6, since this is the recommend version in our industry, since we don't officially switch to IM7 yet
but do you know if there is a bug when comparing image to see if they are same in IM6?

this is the command I am using, but in did not work for some image
convert -metric "AE" image1.png image2.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by fmw42 »

That is not a correct command. It should be the following (assuming the two images are exactly the same size). Note compare not convert.

Code: Select all

compare -metric AE image1.png image2.png null:
or

Code: Select all

compare -metric AE image1.png image2.png diffimage.png
Where null: means no ouput image and diffimage.png can be any name or suffix and would show the differences. See

https://legacy.imagemagick.org/script/compare.php
https://imagemagick.org/Usage/compare/

For IM 7, it would need to be prefaced with magick, so

Code: Select all

magick compare -metric AE image1.png image2.png null:
niyanwen
Posts: 71
Joined: 2019-05-23T16:19:12-07:00
Authentication code: 1152

Re: Image Magick 7 VS 6, for some command not working in 6, but 7 is much slower

Post by niyanwen »

I got it work, thanks
Post Reply