Density escape values in FX expressions?
Posted: 2016-01-02T22:27:51-07:00
Using ImageMagick 7.0.0-0 Q16 x64 2015-12-19 from the command line and batch files in Windows 7 Pro 64.
I'm building some scripts to make various labels to print with finished sizes and crop marks in inches and fractions. I'd like to calculate some dimensions in my IM7 commands using the resolution, or density values. These are available as IM escape characters "x" and "y" in the "identify -format..." command or when printing the density values in a "label:" or "-annotate" command. I'd like to use the density escapes in FX expressions, too.
As a simplified example, where this command works...
... a command like this fails...
It would be great if I could feed source images to some scripts without manually checking the resolutions and calculating those values. Is there any chance the %[x] and %[y] density escapes might be used in FX expressions in future releases of IM7?
I'm building some scripts to make various labels to print with finished sizes and crop marks in inches and fractions. I'd like to calculate some dimensions in my IM7 commands using the resolution, or density values. These are available as IM escape characters "x" and "y" in the "identify -format..." command or when printing the density values in a "label:" or "-annotate" command. I'd like to use the density escapes in FX expressions, too.
As a simplified example, where this command works...
Code: Select all
magick -size 400x400 xc:blue -gravity center -extent %[fx:w+(72/2)]x%[fx:h+(72/2)] clipboard:
Code: Select all
magick -size 400x400 xc:blue -gravity center -extent %[fx:w+(x/2)]x%[fx:h+(y/2)] clipboard: