17

My goal is to determine the compression parameters of the jpeg image that I have. As I understood from this answer, it's possible using the ImageMagick function identity. I downloaded from the official site and installed ImageMagick-7.0.2-7-Q16-x64-dll.exe. Now, I have an application with GUI called ImageMagick Display that seems useless. Where can I find an IM command line to type this:

identify -format '%Q' yourimage.jpg
fmw42
  • 46,825
  • 10
  • 62
  • 80
Glinka
  • 483
  • 1
  • 3
  • 18
  • 1
    `Start`->`All programs`->`Accessories`->`Command Prompt`. Then type `magick identify -format %Q SomeFile.jpg` – Mark Setchell Aug 09 '16 at 08:42
  • @MarkSetchell, sadly, 'magick' is not recognized as an internal or external command, operable program or batch – Glinka Aug 09 '16 at 13:23
  • 5
    If you didn't add the directory where you installed ImageMagick to your PATH, Windows won't be able to find it. You have 2 choices. 1) Use the full path every time you run ImageMagick, i.e. something like `"C:\Programs\Image Magick\convert"` or 2) Go to `Settings`->`System`->`Advanced`->`Environment Variables` and click `Edit` and add the directory in to the start of your PATH. – Mark Setchell Aug 09 '16 at 15:12
  • Put `C:\Program Files\ImageMagick` (or wherever you installed it) in your environment variable path (should have already occured during installation) and use `magick identify` not `identify`. Any command name you want to use put `magick` before it. – JoseOrtiz3 Apr 02 '20 at 03:33

6 Answers6

16

Since it is version 7.x, there is a checkbox at the time of installation that says 'Install legacy utilities (e.g. convert)'. You need to select that checkbox during installation.

Screenshot: enter image description here

Once done, you will be able to use the commands from command line.

Another option is to use the command magick identify --version

For version 6.x, it is not necessary.

wittrup
  • 1,535
  • 1
  • 13
  • 23
Yasin
  • 1,906
  • 1
  • 21
  • 37
4

Open cmd>give access to your path in cmd then hit Enter.
Now type magick identify "D:\your path\name of file" then hit Enter,

enter image description here

MarianD
  • 13,096
  • 12
  • 42
  • 54
0

Type it into the command prompt; alternatively you could put it into a batch file and drop your image over the batch file icon. But in both cases you would then need to think of a way to display the result.

Bonzo
  • 5,169
  • 1
  • 19
  • 27
  • Also you could redirect the output to file `identify -format '%Q' yourimage.jpg > output.txt` and read it in notepad. Or even redirect output to clipboard `identify -format '%Q' yourimage.jpg | clip` and paste it in your favorite text editor. – rostok Aug 08 '16 at 10:35
  • @rostok, `'identify' is not recognized as an internal or external command, operable program or batch` as expected – Glinka Aug 08 '16 at 11:59
  • Did you allow Imagemagick to add the path to environmental variables on install? This identify -format '%Q' E:\Pictures\_MG_5189.jpg > E:\Pictures\output.txt gives me an output of '99' in the text file although I am using 6.9.3. "as expected" sounds a bit pompus; if you do not like Imagemagick find something else? – Bonzo Aug 08 '16 at 12:10
  • "Did you allow Imagemagick to add the path to environmental variables on install?" Hmm.. I didn't forbid. Can I do it manually? "as expected" means that I expected that, since I had already tried. – Glinka Aug 09 '16 at 13:31
0

Try this from command line

type "C:\Program Files\ImageMagick-7.0.7-Q16\magick.exe" identify -format '%Q' yourimage.jpg

replace "C:\Program Files\ImageMagick-7.0.7-Q16\magick.exe" with your directory that has ImageMagick-...\magick.exe installed, and place double quotes at the start of "C:\.... and at the end ...magick.exe",

MarianD
  • 13,096
  • 12
  • 42
  • 54
user1420482
  • 147
  • 3
  • 12
0

Hope ImageMagick is installed in location C:\Program Files (x86)\ImageMagick-7.0.8-Q16

If you are using Imagemagick version above 7.0

C:\Program Files (x86)\ImageMagick-7.0.8-Q16>magick.exe compare -metric RMSE -subimage-search "C:\inetpub\wwwroot\WebServices\Service\Test\636753876766621882_cropped_test_1.jpg" "C:\inetpub\wwwroot\WebServices\Service\Test\crpd_ref_test_.jpg" null:-

1227.74 (0.0187342) @ 50,50 => output

For image magick below 7.0

C:\Program Files (x86)\ImageMagick-7.0.8-Q16>compare.exe -metric RMSE -subimage-search "C:\inetpub\wwwroot\WebServices\Service\Test\636753876766621882_cropped_test_1.jpg" "C:\inetpub\wwwroot\WebServices\Service\Test\crpd_ref_test_.jpg" null:-

1227.74 (0.0187342) @ 50,50 => output

Nikhil Dinesh
  • 3,359
  • 2
  • 38
  • 41
0

if you want to use zsh to call the command line on windows, just add:

export magick=/path/to/exe 
Eg. export magick=/c/Program Files/ImageMagick-7.1.0-Q16-HDRI/magick.exe