convert -get attribute myvariable

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
dmafackler

convert -get attribute myvariable

Post by dmafackler »

Is there a mechanism to read (get) and re-use image attributes in the "convert" pipeline?

i.e. hypothetically:

convert \(srcImage.tif -get height\) \(virtualRuler.tif -crop x%[height]+0+0\) +append srcPlusRuler.tif

I would like to take the attributes of a template image and apply them to another image.

For example: take a ruler image, appropriately scale it, and place it next to the calibrated content of a geophysical image. In this case the calibrating attributes of the 2nd are used to appropriately scale and set the attributes of the 1st before appending the two together.

Understood that this can be accomplished:

* Under *nix'ish shells using back-quoted identify commands
* Or via one of the ImageMagick language APIs (Perl, PHP, C/C++)

but am looking for a cleaner command-line solution under Windows, if such exists.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert -get attribute myvariable

Post by anthony »

At the moment it is the API that does that sort of work. The backquotes for commandline, or variables in other API's.

sorry, windows scripting is braindead!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply