PNG Batch resizing and saving while preserving transparency

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 .png files in the current directory. Note that it 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.


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


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


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.