How do I reduce the dimensions of large .png images? I've tried GIMP, Paint.NET, and IrfanView, and they work well for smaller images but won't even open larger ones.
4 Answers
Have you looked at Imagemagick? It is a command-line tool. Docs talk specifically about large image support. And it is open source.
- 9,053
I tried benchmarking ImageMagick vs. nip2 (as mentioned by Phil above) on a 23,000 by 26,000 RGB PNG, with the default compression level 6. This file is about 600MB on disk, and around 1.6GB when uncompressed. I used a 5 year old HP workstation (2 x Opteron 254s at 2.7GHz, 4GB memory).
nip2 took 35s to load the image. I resized to 80% of the original and selected bicubic interpolation using Image / Transform / Resize / Scale. I pressed 'save' and selected compression level 6 again. The save operation took around 200s. Peak memory use was about 250MB (peak rss as seen by top).
I did the same operation in ImageMagick with the command:
convert -define registry:temporary-path=/tmp -limit memory 250mb big8.png -resize 80% big8c.png
Memory use reached 2.1GB initially, I imagine as the image was decompressed to memory, then dropped away to about 250MB as processing began. Unfortunately during this processing phase CPU utilisation never rose above about 3%; it seemed to be spending almost all its time swapping to disk. I let it run for 30 minutes with no result, then killed it.
Grab a trial of Photoshop from adobe.com, it should work well for what you're looking to do. Otherwise you could use something like Picasa that can export images at a specific resolution.
- 784