Enlarge small images

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
danield
Posts: 12
Joined: 2013-06-25T00:16:00-07:00
Authentication code: 6789

Enlarge small images

Post by danield »

Hello,

I have small and large images in a folder. I need to enlarge smaller images than 1000x1000 to 1000x1000 in a folder. If there are greater images in the folder than 1000x1000 to leave them as they are without any change.

If it is possible to keep the quality of the image during the enlargement to 1000x1000 will be great. I'm using the code below where it is enlarging all the images in the folder but if I already have images 1000x1000 it is also modifying them so I prefer not to touch the already large images.

mogrify -resize '1000x1000<' *.gif

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Enlarge small images

Post by fmw42 »

What IM version and platform? Always provide that information, please.

I would think that your command should work. Does it work if you do a few with convert rather than mogrify.

However, any resizing will change colors. So if you have input gif images with low number of colors then, they will get larger due to having more colors after the resizing.

If you create a loop over all the images in a folder and use convert, then you can use -remap to convert the colors back to some common set of colors, if that would help. I am not sure what your situation is with your gif images.
danield
Posts: 12
Joined: 2013-06-25T00:16:00-07:00
Authentication code: 6789

Re: Enlarge small images

Post by danield »

Thank you for replying. How can I check which version of IM I have? Sorry I'm not a programmer.

I'm basically changing jpg images. The code is working but if I already have in the folder big images the code is changing them as well. I also prefer a code if possible that doesn't impact the quality of the image so I need to modify only images less than 1000x1000.

Dan
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Enlarge small images

Post by snibgo »

"convert -version" will give the IM version, eg "Version: ImageMagick 6.9.2-5 Q16 x64".

Your platform is Windows or Unix or whatever. This is important because different platforms expect different types of quotes.
snibgo's IM pages: im.snibgo.com
danield
Posts: 12
Joined: 2013-06-25T00:16:00-07:00
Authentication code: 6789

Re: Enlarge small images

Post by danield »

Will check later the version of ImageMagick. I have linux.
danield
Posts: 12
Joined: 2013-06-25T00:16:00-07:00
Authentication code: 6789

Re: Enlarge small images

Post by danield »

Hi, my server currently utilizes 3.3.0.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Enlarge small images

Post by snibgo »

"3.3.0" doesn't seem a likely version of ImageMagick.

Please paste the exact output from "convert -version".
snibgo's IM pages: im.snibgo.com
Post Reply