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?".
pnowak
Posts: 4 Joined: 2019-05-30T11:03:02-07:00
Authentication code: 1152
Post
by pnowak » 2019-05-30T11:51:56-07:00
Some parameters calculated. But something is wrong:
OS Windows 7 pro.
ImageMagick 7.0.8Q16
Constant parameters (first -annotate) work:
Code: Select all
convert %1 -bordercolor Black -border 64x64 -font Gadugi -pointsize 36 -fill white -gravity southwest -annotate 0x0+64+10 "%%[EXIF:ImageDescription]" -gravity southeast -annotate 0x0+64+10 "TEXT" %1b.jpg"
Calculated parameters (first -annotate) don't work:
Code: Select all
convert %1 -bordercolor Black -border 64x64 -font Gadugi -pointsize 36 -fill white -gravity southwest -annotate "0x0+%%[fx:min(h,w)/50]+10" "%%[EXIF:ImageDescription]" -gravity southeast -annotate 0x0+64+10 "TEXT" %1b.jpg"
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2019-05-30T11:54:29-07:00
What happens? Can you show the two results? You can upload to some free hosting service and put the URLs here.
What is your exact IM 7 version (7.x.x.x)?
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-05-30T12:02:22-07:00
pnowak wrote: Calculated parameters (first -annotate) don't work: ...
Use "magick" instead of "convert".
pnowak
Posts: 4 Joined: 2019-05-30T11:03:02-07:00
Authentication code: 1152
Post
by pnowak » 2019-05-30T12:10:34-07:00
version 7.0.8-Q16
I need to calculate some parameters from size of image. But imageMAgick documentation seems very poor to me. I'm not able to find: how to calculate, where get image size, etc.... So I try some examples but without success.
"-border 0x0+64+10" works.
I need to calculate "min(imageHeight,imageWidth)/50" instead of 64.
is it right?
-border "0x0+%%[fx:min(h,w)/50]+10"
It returns eror:
convert: invalid argument for option '-border': %[fx:w/50]x64 @ error/convert.c/ConvertImageCommand/839.
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-05-30T12:27:18-07:00
As I said: Use "magick" instead of "convert".
pnowak
Posts: 4 Joined: 2019-05-30T11:03:02-07:00
Authentication code: 1152
Post
by pnowak » 2019-05-30T12:34:25-07:00
@snibgo:
really? That way?
"C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe" magick %1 -bordercolor Black -border 50%x50% -font Gadugi -pointsize 36 -fill white -gravity southwest -annotate 0x0+64+10 "%%[EXIF:ImageDescription]" -gravity southeast -annotate 0x0+64+10 "TEXT" %1b.jpg"
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-05-30T13:28:51-07:00
pnowak wrote: "C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe" magick %1 ...
No. I said: Use "magick" instead of "convert". You have "magick" twice. And you've removed "%[fx...]" from your "-border" and "-annotate".
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2019-05-30T16:26:45-07:00
Most inline computations do not work in ImageMagick 6 (with convert). But they do work in ImageMagick 7 (with magick replacing convert).
pnowak
Posts: 4 Joined: 2019-05-30T11:03:02-07:00
Authentication code: 1152
Post
by pnowak » 2019-05-30T21:23:05-07:00
@snibgo + fmw42: Perfect. It works now. Thanks !!!