4

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.

  • What programs have you tried? GIMP, Photoshop, IrfanView (x64), ImageMagick - they all should take it. – flolilo Jan 29 '18 at 22:23
  • I think GraphicsMagick can handle gigapixel images. – StephenG Jan 29 '18 at 22:25
  • @flolilolilo - Photoshop cannot. It has a lard limit on image dimensions. – Itai Jan 30 '18 at 22:35
  • 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. – Mark Ransom Jan 31 '18 at 16:50
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.

| improve this answer | |
  • 1
    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. – StephenG Jan 30 '18 at 9:07
  • That's an excellent remark, given the 10GB image size I should have been more careful before giving an answer indeed. – calocedrus Jan 31 '18 at 4:16
  • 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. – ths Jan 31 '18 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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