How can I downscale a very large TIFF texture map without fully opening it?
Asked 1/29/2018
3 views
2 answers
0
I downloaded a very large lunar texture map TIFF (around 10GB) and my Windows 10 PC with 12GB RAM can't open it in a normal image editor. I only need a smaller version for a project. Is there a way to resize/downscale the TIFF without loading the full image into a GUI application?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
8y ago
2 Answers
3
Update:
@StephenG accurately noted that for such a large image, IM (ImageMagick) convert may cause problems. The simple convert command could lead to 100% of your CPU being used, or freeze, hang, or crash.
One solution (untested, the download of the 10GB file keeps on aborting) is to do the following:
env MAGICK_TMPDIR=/path_to/10GB/hdd_space \
convert -limit memory 1mb -limit map 2mb \
moon_10GB.tiff -resize 1080 moon_smaller.jpg
By limiting your memory usage to a very small amount (wrt 10GB), this will force IM to use your HDD as cache. Some more info on the IM forum, this post and this one.
Install and use (in a console) ImageMagick with the following convert command to get an image of the dimension you wish (here 1080px wide or high, see below):
convert your_input_image.tif -resize 1080 resized_image.jpg
The size you specify with the option -resize is the one of the largest dimension of your image. That means that in landscape mode your final image will be 1080px wide, while in portrait it will be 1080px high.
Originally by user61932. Source · Licensed CC BY-SA 4.0
user61932
8y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. A command-line tool such as ImageMagick can resize a huge TIFF without opening it in a normal editor. Because the file is so large, using the basic convert command may peg the CPU or hang if it tries to use too much RAM. The safer approach is to force ImageMagick to use disk as cache and set very low memory limits.
Example:
convert -limit memory 1mb -limit map 2mb input.tif -resize 1080 output.jpg
You can also set a temporary directory with lots of free disk space so ImageMagick can write cache files there.
This works because the program streams the image data and uses temporary storage instead of requiring the whole TIFF to fit in RAM. Expect it to be slow, and make sure you have plenty of free drive space.
So in short: yes, you can downscale it without fully opening it in a GUI, but use a command-line tool and enough scratch disk space.
Recommended products
UniqueBot
AI8y ago
Your Answer
Related Questions
How can I tone map a very large HDR panorama after stitching?
Can a TIFF be rotated 90° without re-encoding or increasing file size?
How do I move a Lightroom catalog and photo library from a Windows PC to a MacBook Pro?
Do I need any filters for photographing the moon with a DSLR and telephoto lens?
Why can Autopano stitch a large 360° panorama more reliably than Hugin?