downsizing a 10GB image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
signuplease
Posts: 1
Joined: 2018-01-31T00:56:36-07:00
Authentication code: 1152

downsizing a 10GB image

Post by signuplease »

Consider this image of the moon:
https://planetarymaps.usgs.gov/mosaic/L ... m_v1.1.tif

Code: Select all

identify Lunar_LRO_WAC_GLD100_DTM_79S79N_100m_v1.1.tif 
returns:

Code: Select all

Lunar_LRO_WAC_GLD100_DTM_79S79N_100m_v1.1.tif TIFF64 109165x47912 109165x47912+0+0 16-bit Grayscale Gray 10.461GB 0.010u 0:00.059
identify: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
identify: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
identify: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
identify: Unknown field with tag 34736 (0x87b0) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
identify: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
identify: Unknown field with tag 42113 (0xa481) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/881.
So it's a 109165x47912 pixels image. Ignoring the warning, I went on to resize it to a smaller size with:

Code: Select all

env MAGICK_TMPDIR=/media/me/Linux_500GB/ImageOfTheMoon convert -limit memory 0.5mb -limit map 1mb Lunar_LRO_WAC_GLD100_DTM_79S79N_100m_v1.1.tif -resize 4096 moon4096.jpg
But after about 1mn, I have the same unknown field related warning as above, and:

Code: Select all

convert: memory allocation failed `Lunar_LRO_WAC_GLD100_DTM_79S79N_100m_v1.1.tif' @ error/tiff.c/ReadTIFFImage/1812.
convert: no images defined `moon_small.jpg' @ error/convert.c/ConvertImageCommand/3210.
There's several post on memory allocation issues (for ex. http://www.imagemagick.org/discourse-se ... =3&t=32455), and a IM help on converting large images (http://www.imagemagick.org/Usage/files/#massive) but I couldn't get this one to resize.

My IM version:

Code: Select all

identify -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
Is there any one adventurous to try the conversion, and/or point me to some other command to try?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: downsizing a 10GB image

Post by magick »

This command worked for us using ImageMagick 7.0.7-22:

Code: Select all

convert -define registry:temporary-path=/fusion/tmp -limit area 0 -limit map 0 Lunar_LRO_WAC_GLD100_DTM_79S79N_100m_v1.1.tif -resize 5% lunar.jpg
Try it with your release of ImageMagick. If it fails you could try upgrading to the latest IMv6 @ 6.9.9-34. If that fails, let us know and we'll investigate further.
Post Reply