Make images larger
Make images larger
Hello,
I need is to enlarge smaller images than 500x500 to 500x500 in a folder. If there are greater images in the folder than 500x500 to leave them as they are without any change.
If it is possible to keep the quality of the image during the enlargement to 500x500 will be great. I currently receive the code below where it is enlarging all the images in the folder smaller than 500x500 but if I already have images 1000x1000 it is also modifying them to 500x500.
find . -name \*.jpg -exec convert -size '500x500' {} -resize '<500x500' {} \;
Any suggestions?
Thanks!
Dan.
I need is to enlarge smaller images than 500x500 to 500x500 in a folder. If there are greater images in the folder than 500x500 to leave them as they are without any change.
If it is possible to keep the quality of the image during the enlargement to 500x500 will be great. I currently receive the code below where it is enlarging all the images in the folder smaller than 500x500 but if I already have images 1000x1000 it is also modifying them to 500x500.
find . -name \*.jpg -exec convert -size '500x500' {} -resize '<500x500' {} \;
Any suggestions?
Thanks!
Dan.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
You need "500x500<". See http://www.imagemagick.org/script/comma ... p#geometry
If either dimension is less than 500, it will be resized so the smaller dimension is 500.
If "<" is a special character in your language, you need to escape it. Eg for Windows:
If either dimension is less than 500, it will be resized so the smaller dimension is 500.
If "<" is a special character in your language, you need to escape it. Eg for Windows:
Code: Select all
convert in.png -resize "500x500^<" out.png
snibgo's IM pages: im.snibgo.com
Re: Make images larger
Hi,
Thank you for your reply. I need this commando for a bulk operation. I have around 1000 images in a folder, some are greater than 500 (I don't need to modify them) and other are smaller than 500 (those I need to modify to 500)
Any idea?
Dan.
Thank you for your reply. I need this commando for a bulk operation. I have around 1000 images in a folder, some are greater than 500 (I don't need to modify them) and other are smaller than 500 (those I need to modify to 500)
Any idea?
Dan.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
Code: Select all
mogrify -resize "500x500^<" *.jpg
snibgo's IM pages: im.snibgo.com
Re: Make images larger
Thank you but after I run the command mogrify -resize "500x500^<" *.jpg I receive the error below:
mogrify: invalid argument for option `500x500^<': -resize.
Please help .
Thanks!
mogrify: invalid argument for option `500x500^<': -resize.
Please help .
Thanks!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
What platform are you on? If not Windows, it will be slightly different, perhaps:
Code: Select all
mogrify -resize '500x500\<' *.jpg
snibgo's IM pages: im.snibgo.com
Re: Make images larger
Still the same error with command: mogrify -resize '500x500\<' *.jpg
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
What platform are you on? What version of IM?
snibgo's IM pages: im.snibgo.com
Re: Make images larger
Linux. Don't know the version of IM but I installed it 2 weeks ago from cpanel. I'm able to use other simple IM commands
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
"convert -version" will display the version number, something like "6.8.6-0 2013-06-15 Q16".
An example on http://www.imagemagick.org/script/comma ... p#geometry doesn't escape "<", so perhaps you don't need to. I don't use any version of Unix, so can't test the possibilities.
An example on http://www.imagemagick.org/script/comma ... p#geometry doesn't escape "<", so perhaps you don't need to. I don't use any version of Unix, so can't test the possibilities.
snibgo's IM pages: im.snibgo.com
Re: Make images larger
I have version: 6.2.8 05/07/12 q16. This helps?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
v6.2.8 is old. Very old. Almost prehistoric. (The date on the line is of the compilation, but the source code is much older.) Perhaps the "<" option wasn't available then.
I suggest you upgrade.
I suggest you upgrade.
snibgo's IM pages: im.snibgo.com
Re: Make images larger
Thank you but I have no idea how to upgrade . I installed it from WHM.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Make images larger
I suspect you need to install from source. See http://www.imagemagick.org/script/insta ... e.php#unix
snibgo's IM pages: im.snibgo.com
Re: Make images larger
The "<" has been around for much longer than that.snibgo wrote:v6.2.8 is old. Very old. Almost prehistoric. (The date on the line is of the compilation, but the source code is much older.) Perhaps the "<" option wasn't available then.
It doesn't need to be (shouldn't be) escaped when it's already inside quotes.