So I have an a lot of images with different height and width. I want to resize the image by percentage, with height at a different percentage and width at a different percentage.
So an image of 200 x 100 pixel i want to convert it by 50% height and 30% width. how would I do that with imagemagick?
how to convert height and width by percentage separately
-
- Posts: 3
- Joined: 2017-01-11T17:54:54-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how to convert height and width by percentage separately
I have moved this message here from Fred's Scripts, since it has nothing to do with my script.
Please always provide your IM version and platform, since syntax may vary.
If on IM 7 use "magick" rather than "convert"
If you want to process multiple images in one folder all at one time, then use mogrify or magick mogrify. See http://www.imagemagick.org/Usage/basics/#mogrify
Please always provide your IM version and platform, since syntax may vary.
Code: Select all
convert image -resize 50%x30% resultimage
If you want to process multiple images in one folder all at one time, then use mogrify or magick mogrify. See http://www.imagemagick.org/Usage/basics/#mogrify
-
- Posts: 3
- Joined: 2017-01-11T17:54:54-07:00
- Authentication code: 1151
Re: how to convert height and width by percentage separately
doesn't work. the result image is 50x25. it didn't even register the 30% width.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: how to convert height and width by percentage separately
You should tell us the IM version you are using, and the platform.
For example, if your code is in a Windows BAT file, "%" has a special meaning (about script parameters). When you don't want that special meaning, you need to double them:
For example, if your code is in a Windows BAT file, "%" has a special meaning (about script parameters). When you don't want that special meaning, you need to double them:
Code: Select all
50%%x30%%
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how to convert height and width by percentage separately
What was your exact command line and your IM version and platform? As I said above, syntax may differ. Did you enter your image in the command as imagename.suffix?
What do you get from
That will tell us your IM version and your delegates.
What do you get from
Code: Select all
convert -version
-
- Posts: 3
- Joined: 2017-01-11T17:54:54-07:00
- Authentication code: 1151
Re: how to convert height and width by percentage separately
Double %% works. Thank you very much.