I am starting to learn more about ImageMagik and I am trying to figure out some things. One of those things is the meanings of properties variables such as %d or %wx%h.
I have googled and googled and can not seem to find a resource that list the meanings.
In particular I am looking for a variable that pulls the file name.
I am working on convert command that resamples an image, changes the quality and gives the file a new name. But I am not sure what variable to use
convert -resample 72 -quality 80% US*.jpg -set orig:%notsurrewhatgoeshere [filename:orig]Sm.jpg
Thanks in advance
Looking for % property variables meanings
Re: Looking for % property variables meanings
See the Imagemagick options page here:
http://www.imagemagick.org/script/comma ... ptions.php
See the examples section here:
http://www.imagemagick.org/Usage
Your code is wrong as the image is read in first - how are you using your code: Linux, php, batch etc.
Are you trying to read a directory of images and process them all ?
http://www.imagemagick.org/script/comma ... ptions.php
See the examples section here:
http://www.imagemagick.org/Usage
Your code is wrong as the image is read in first - how are you using your code: Linux, php, batch etc.
Code: Select all
convert US*.jpg -resample 72 -set orig:%notsurrewhatgoeshere [filename:orig] -quality 80 Sm.jpg
Re: Looking for % property variables meanings
Thanks for your help
I am using Linux and doing batch processing.
I found the page I was looking for
http://www.imagemagick.org/script/escape.php
and I believe I have my syntax correct
convert *.jpg -resample 72 -quality 80% -set filename:orig %t %[filename:orig]Sm.jpg
I am using Linux and doing batch processing.
I found the page I was looking for
http://www.imagemagick.org/script/escape.php
and I believe I have my syntax correct
convert *.jpg -resample 72 -quality 80% -set filename:orig %t %[filename:orig]Sm.jpg
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Looking for % property variables meanings
That is quite good. But I would warn you that it will read ALL you images into memory first at there full size.
More than likely you will end up with a very slow processing as IM switched to using disk space when memory limits are reached.
One way of reducing memory needs is to use read modifiers to "resize on read"
http://www.imagemagick.org/Usage/files/#read_mods
You can combine this with JPEG size hints. But make the jpeg size hint a little larger so it does not reduce your thumbnail quality.
See Thumbnail Handling
http://www.imagemagick.org/Usage/thumbnails/#profiles
And finally process your images one at a time, or in groups, using a 'find | xargs' pipeline.
For example look for jpg files which are not 'Sm' Jpg files.
that has the added advantage of also allowing recursive searches of a directory tree!
See the man pages for find and xargs.
Also see.. Batch processing alternatives...
http://www.imagemagick.org/Usage/basics/#mogrify_not
More than likely you will end up with a very slow processing as IM switched to using disk space when memory limits are reached.
One way of reducing memory needs is to use read modifiers to "resize on read"
http://www.imagemagick.org/Usage/files/#read_mods
You can combine this with JPEG size hints. But make the jpeg size hint a little larger so it does not reduce your thumbnail quality.
See Thumbnail Handling
http://www.imagemagick.org/Usage/thumbnails/#profiles
And finally process your images one at a time, or in groups, using a 'find | xargs' pipeline.
For example look for jpg files which are not 'Sm' Jpg files.
Code: Select all
find . -type f -name '*.jpg' \! -name '*Sm.jpg' -print0 | xargs -0 -i convert '{}' ....
See the man pages for find and xargs.
Also see.. Batch processing alternatives...
http://www.imagemagick.org/Usage/basics/#mogrify_not
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/