I have an image with a 18984x28591px resolution but I can't open it with Paint or with Pixlr Editor to reduce its size.
How can I convert or open this large image on my laptop?
I have an image with a 18984x28591px resolution but I can't open it with Paint or with Pixlr Editor to reduce its size.
How can I convert or open this large image on my laptop?
I used ImageMagick on Ubuntu to resize those big pictures.
convert -resize 10% source.jpg dest.jpg
It took awhile, but worked with 1 GByte of RAM, the tool created a 4.7 Gbyte swap-like file for itself.
More information is on AskUbuntu.
convert -resize 1898x2859 ...
\$\endgroup\$
Commented
Oct 17, 2014 at 23:19
Theoretically, most image formats could be downscaled progressively, without loading the entire image into memory, however I do not know any tools that really implement such feature, except for JPEG: it is special in that you can not only downscale without loading full resolution, but also downscale without decoding full resolution, thanks to the creative use of DCT (JPEG is encoded in frequency domain, which means it does not have to be decoded to the exact same resolution as the original image).
The default JPEG decoding tool (command line, libjpeg-progs package in Linux, look for djpeg.exe for Windows) will downscale huge JPEG before a "regular" application can even finish loading it:
djpeg -scale 1/8 huge_image_that_will_not_fit_in_your_ram.jpg >downscaled.ppm
I have also seen the downscale-while-loading option in some GUI application, too, but can't recall it at the moment.
Comparing the memory usage and processing time of ImageMagick vs djpeg downscaling a big image (piping to cjpeg, so the resulting image is also jpg, for a fair comparison with convert)
$ display -verbose input.jpg
input.jpg JPEG 13114x11722 13114x11722+0+0 8-bit sRGB 30.75MB 6.690u 0:06.699
$ /usr/bin/time -f "time=%E mem=%MK" bash -c "convert input.jpg -scale '12.5%' output.jpg"
time=0:10.72 mem=1225844K
$ /usr/bin/time -f "time=%E mem=%MK" bash -c "djpeg -scale 1/8 input.jpg | cjpeg > output2.jpg"
time=0:00.88 mem=1412K
1,2GB vs 1,4MB and over 10 times slower - and this was on a relatively small 13k x 11k image that could fit entirely in RAM so no swapping occured.
On the other hand, using djpeg for downscaling also has its own limitations: scaling factor choice is limited and the resampling method can't be changed.
You can also try using Picture Resizer on Windows (I love this tool)
You simply drag and drop the picture on this simple EXE It is especially useful if you have many pictures to convert as you can do many at a time.
All the config is done through the naming of the EXE which is brilliant IMO
I have never tried it with huge file though.