Page 1 of 1

Converting and Copying Images of any extensions

Posted: 2016-07-08T06:55:43-07:00
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!

Re: Converting and Copying Images of any extensions

Posted: 2016-07-08T07:05:25-07:00
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.

Re: Converting and Copying Images of any extensions

Posted: 2016-07-08T08:47:55-07:00
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.