Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got about 700+ png images. I need to resize and save them. However I also need their transparency to be intact.

I tried Irfanview, but that didn't work. GIMP works, but I can't find a batch saving option. I'm not going to manually resize and save 700+ images. That's too tedious.

Is there any applications out there that do the job I need ?

share|improve this question
    
Have you tried ImageMagick? –  slhck Mar 19 '13 at 8:12
    
No, but isn't that for servers? –  Don Salva Mar 19 '13 at 9:54
1  
What do you mean, for servers? It's a command-line software that can be run on any operating system. –  slhck Mar 19 '13 at 9:57
    
Yea, no. Command-line isn't my strength. I need something with a handy GUI. –  Don Salva Mar 19 '13 at 10:38
    
@DonSalva you can do it within 2 lines of cmd by using ffmpeg, even without strength –  Jet Apr 29 at 14:26

5 Answers 5

up vote 4 down vote accepted

Sorry, you are going to have to use the command line. I really really doubt that you can find a GUI program to deal with this.

You have not specified which OS you are using. On Linux, the following command will resize all files .png files in the current directory, it will not overwrite the original file, just create a copy with the ne size (assuming you have ImageMagick installed):

convert  -resize 64x64 *png

This command will overwrite the original images:

##  bash (Linux, OSX):
for i in *png; do convert $i -resize 32x32 $i; done
##  on Windows:
for %i in (*png); do convert %i -resize 32x32 %i; done

Note that, for the Windows line, if you are using it in a script rather than on the command-line, you need to use %%i rather than %i.


Another option would be GIMP scripting. This script will resize your image (source):

(define (batch-resize pattern width height)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(gimp-image-scale-full image width height INTERPOLATION-CUBIC)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))

Save it as batch_resize.scm in GIMP's scripts directory, then run it as follows:

gimp -i -b '(batch-resize "*.JPG" 604 453)' -b '(gimp-quit 0)'

UPDATE:

I just stumbled upon this post that suggests that the GIMP plugin David’s Batch Processor should do exactly what you want. The article is about Linux but there is a link to a windows version on the plugin's page.

share|improve this answer
    
My bad, I always forgot the OS. It's Win7 64bit. –  Don Salva Mar 19 '13 at 21:53
    
Well, ImageMagick has a windows version and you should (somehow) be able to use the GIMP script in windows as well. –  terdon Mar 19 '13 at 21:55
    
@DonSalva see updated answer. –  terdon Mar 19 '13 at 22:08
    
ImageMagick is an awesome tool for this type of work. Learn how to use it and you'll love it forever! –  Lee Harrison Mar 19 '13 at 22:15
    
All thanks to @evilsoup for adding the windows command line. –  terdon Mar 20 '13 at 0:12

I think ImBatch tool can help you with your task. Works fine with Win7 x64 for me. It is free.

share|improve this answer
    
Great tool, much more flexible than IrfanView and supports png with alpha - thanks! –  Tomáš Kafka Apr 3 '13 at 23:20

XNConvert has a simple and intuitive GUI for those tasks.

XnConvert is a powerful and free cross-platform batch image processor, allowing you to combine over 80 actions. Compatible with 500 formats. It uses the batch processing module of XnViewMP

  • batch processing
  • preservs transparency (tested with a transparent PNG)
  • automatic or predefined resize
  • no installation necessary

enter image description here

share|improve this answer
    
I tried this and it didn't maintain transparency (Mac version). Does it make what kind of resampling is used (I used Lanczos as you did). –  niico Sep 2 at 22:51
    
Worked this out myself - using Bilinear Resampling does it. You can see in the 'After' window how it's going to look - if the transparent area is black you know it's not going to work. –  niico Sep 2 at 23:07
    
@niico I now tried 3 different resample methods, Lanczos too. They all produce transparent images. Maybe the MAC version works in a different way –  nixda Sep 2 at 23:11
    
I tried this on PC and Mac - identical on both. Further - I now notice the resampling I did is jaggy as hell and unusable. –  niico Sep 4 at 3:58

By default, using FFMpeg is the shortest way :)
Download it here, put it in the folder with your files, open command line, go to your folder (with cd) and write there:

mkdir Resized
for %f in (*.png) do ffmpeg -i "%~nxf" -s 32x32 "Resized\%~nxf"

and change 32x32 with your size. It will resize your PNGs and put it on Resized folder.
This will do the work without batch file. However if you want to put this in bat file, write %% in place of %.

Hope it will help you.

share|improve this answer

I haven't tried ImBatch or XNConvert, that others mentioned here, but here are a couple of more suggestions for you:

  • pngquant (a command-line tool. Myself, I used the Windows GUI PNGoo included on the page)
  • Color quantizer (lots of possibilities to tweak settings to use various dithering algorithms etc. I never got it to work as well as PNGoo/pngquant, but that might be because of my limited knowledge).
  • TinyPNG.com (the free web service has a limit of 20 files, each smaller than 5MB)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.