4
\$\begingroup\$

I have downloaded a texture map. Found here: https://astrogeology.usgs.gov/search/map/Moon/LRO/LROC_WAC/Lunar_LROC_WAC_GLD100_79s79n_118m_v1_1

And I cannot open it so I can downscale it to use it in a project of mine. Is there anyway I can do that without actually opening it?

Specs: 12GB of RAM. Windows 10 x64

Thank you.

\$\endgroup\$
4
  • \$\begingroup\$ What programs have you tried? GIMP, Photoshop, IrfanView (x64), ImageMagick - they all should take it. \$\endgroup\$
    – flolilo
    Commented Jan 29, 2018 at 22:23
  • \$\begingroup\$ I think GraphicsMagick can handle gigapixel images. \$\endgroup\$ Commented Jan 29, 2018 at 22:25
  • \$\begingroup\$ @flolilolilo - Photoshop cannot. It has a lard limit on image dimensions. \$\endgroup\$
    – Itai
    Commented Jan 30, 2018 at 22:35
  • \$\begingroup\$ I could write a program to do this. It's not a hard problem if you don't have to open the entire file all at once, but most programs do open the whole thing. \$\endgroup\$ Commented Jan 31, 2018 at 16:50

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ You probably ought to read this Imagemagick document regarding massive image handling. I don't think it's a good idea to just use convert without setting some process limits for ImageMagick or you could end up with the IS thrashing which is a disaster for performance and can make a job that could take e.g. ten minutes take days if not actually hang the system. \$\endgroup\$ Commented Jan 30, 2018 at 9:07
  • \$\begingroup\$ That's an excellent remark, given the 10GB image size I should have been more careful before giving an answer indeed. \$\endgroup\$
    – calocedrus
    Commented Jan 31, 2018 at 4:16
  • \$\begingroup\$ IM should automatically swap if the available RAM is exceeded. the ridiculous limit above is a kludge to force IM to swap constantly, thereby reducing CPU load. if you want to set a RAM limit, at least use a sensible one or you'll wait until next century. \$\endgroup\$
    – ths
    Commented Jan 31, 2018 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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