DETECT IMAGE SIZE
-
- Posts: 26
- Joined: 2011-02-08T04:37:21-07:00
- Authentication code: 8675308
DETECT IMAGE SIZE
I want to detect input image size can anyone guide?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: DETECT IMAGE SIZE
convert image -format "%wx%h" info:
or
identify -format "%wx%h" image
gives the width x height
convert image -format "%b" info:
or
identify -format "%b" image
gives the filesize
see string formats at http://www.imagemagick.org/script/escape.php
or
identify -format "%wx%h" image
gives the width x height
convert image -format "%b" info:
or
identify -format "%b" image
gives the filesize
see string formats at http://www.imagemagick.org/script/escape.php
-
- Posts: 26
- Joined: 2011-02-08T04:37:21-07:00
- Authentication code: 8675308
Re: DETECT IMAGE SIZE
thank you very much
-
- Posts: 26
- Joined: 2011-02-08T04:37:21-07:00
- Authentication code: 8675308
Re: DETECT IMAGE SIZE
Next que.. after getting height and width, i want to store them in some variable and add 100, so i had tried further as below but not working. can you please guide in this?
but it wont working at
1) storing in ht,wd
2) defining concatenated string by sz
Code: Select all
set ht=identify -format "%h" im1.png
set wd=identify -format "%w" im1.png
set /A ht=ht+100
set /A wd=wd+100
set "sz=%ht%x%wd%"
convert -size sz xc:black output.png
1) storing in ht,wd
2) defining concatenated string by sz
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: DETECT IMAGE SIZE
on unix
newht=$((ht+100))
or you can compute it from scratch
newht=`convert image -format "%[fx:h+100]" info:`
or
newht=$(convert image -format "%[fx:h+100]" info:)
newht=$((ht+100))
or you can compute it from scratch
newht=`convert image -format "%[fx:h+100]" info:`
or
newht=$(convert image -format "%[fx:h+100]" info:)
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: DETECT IMAGE SIZE
IMv7 "magick" command will allow you to do all this in the one command line (or file script).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/