Hey everyone - I've seen ImageMagick before, but have a specific project I'm struggling to find a solution for and this seems as close as I have gotten.
I have 10,000 files in a folder, for example - CMYK TIFF that I want to convert to PNG. However, I don't want to convert all of them, only ones that are larger than 1000pixel on either height or width.
My first thought was that I could do this with the -resize 1000^< (windows user). However, even if that kinda works, it ends up resizing the image and I don't really want to resize the image, I just want to convert it.
I have searched through the forums for skipping, ignoring, and such but I can only find the ability to resize to a specific size, not just ignoring files of a smaller size. Any help would be greatly appreciated!
TW
Convert images to different format only if size is greater..
-
- Posts: 2
- Joined: 2012-01-05T14:38:06-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert images to different format only if size is great
I think you will have to write a script (Bat file) to loop over all your images, compute the image sizes as variables using -format "%w" and -format "%h" and use a conditional test on the image sizes to determine if you want to convert them or skip them.
See http://www.imagemagick.org/Usage/windows/ as I am not a windows user and can only show you how to do it in Unix/IM syntax.
See http://www.imagemagick.org/Usage/windows/ as I am not a windows user and can only show you how to do it in Unix/IM syntax.
-
- Posts: 2
- Joined: 2012-01-05T14:38:06-07:00
- Authentication code: 8675308
Re: Convert images to different format only if size is great
Wow thanks for the super-quick reply.
I hadn't thought of that, but you're right - since .bat files will allow integer variables. I always forget that.
If I'm able to write that, I'll come back and post it if it can help anyone else.
I hadn't thought of that, but you're right - since .bat files will allow integer variables. I always forget that.
If I'm able to write that, I'll come back and post it if it can help anyone else.
Re: Convert images to different format only if size is great
There might be a batch file on my site that will get you started: http://www.rubblewebs.co.uk/imagemagick/batch.php