Converting and Copying Images of any extensions

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
kgt882
Posts: 4
Joined: 2016-07-07T09:33:10-07:00
Authentication code: 1151

Converting and Copying Images of any extensions

Post by kgt882 »

I want to be able to convert an image into different sizes, but not just jpg or png, whatever file I drag onto the batch file.

For example: convert "%1" -thumbnail 50x -unsharp 1.5x1.2+1.0+0.10 "%~p1resizedthumbnail_%~n1.jpg"

This will make a copy of the image into the size I stated. It also renames it. But this only works for jpg. I was wondering how I can be able to convert images with any extensions such as .png .jpeg etc etc.


I tried mogrify, but it didn't make a new copy of the file, instead, it just replaced the dimensions of the current file I dragged onto the batch file itself. Because I will be making multiple sizes of the same image, this was somewhat useless or I did not use it correctly.

Thank you in advanced!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting and Copying Images of any extensions

Post by snibgo »

kgt882 wrote:But this only works for jpg.
What does that mean? Do you get an error message or what?

It should work for any input extension. The output will always be jpg, because that is what you asked for.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting and Copying Images of any extensions

Post by fmw42 »

To make a new copy with mogrify, you have to write the output to another (empty) directory using the -path option in mogrify. Otherwise, it overwrites the old image with the new one.
Post Reply