Resizing huge images failing
Resizing huge images failing
Hi - I'm trying to reduce a tif image from 94095x54316 to 9410x5432 by using the -resize 10% option, but getting an "unable to extend cache" error:
C:\Users\Matt>convert -monitor -limit memory 2GiB -limit map 4GiB -define registry:temporary-path=c:\temp Huge.tif -resize 10% Haircut.tif
Error message:
convert: unable to extend cache 'Huge.tif': No space left on device @ error/cache.c/OpenPixelCache/3607.
convert: no images defined `Haircut.tif' @ error/convert.c/ConvertImageCommand/3253.
I tried all the suggestions for increasing cache, but still get errors. Any ideas?
I have 32GB of RAM / Windows 10
Thank you!
C:\Users\Matt>convert -monitor -limit memory 2GiB -limit map 4GiB -define registry:temporary-path=c:\temp Huge.tif -resize 10% Haircut.tif
Error message:
convert: unable to extend cache 'Huge.tif': No space left on device @ error/cache.c/OpenPixelCache/3607.
convert: no images defined `Haircut.tif' @ error/convert.c/ConvertImageCommand/3253.
I tried all the suggestions for increasing cache, but still get errors. Any ideas?
I have 32GB of RAM / Windows 10
Thank you!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Resizing huge images failing
What have you run out of, disk space or memory? "No space left on device" sounds like disk.
snibgo's IM pages: im.snibgo.com
Re: Resizing huge images failing
I'm assuming memory. I have 28GB free on my C:\ drive. A little low but should be enough. Let me free up some space to see if that makes a difference.
Thanks
Thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Resizing huge images failing
Just to store the image in memory needs 94095*54316 * 8 / 1e9 = 40.88 GB. So you ran out of disk (virtual memory).
snibgo's IM pages: im.snibgo.com
Re: Resizing huge images failing
Looks like you were dead on with that tip. It's processing...I'll update when it's done. Thank you!
The "8" represents 4 channels at 2 bytes each? If I used Q8 it would take half the space?
[UPDATE]
It got farther but still ended up with a "unable to extend cache"
The "8" represents 4 channels at 2 bytes each? If I used Q8 it would take half the space?
[UPDATE]
It got farther but still ended up with a "unable to extend cache"
Re: Resizing huge images failing
I don't think so. My D drive has 400GB free and that's where I'm loading and saving.
I took a look at LibTiff and was able to extract a smaller page from the 8 paged Tif. I wasn't sure what approach would work best, but it looks like I'll be using LibTiff for this solution.
Thanks for all your help. I really appreciate it.
Matt
I took a look at LibTiff and was able to extract a smaller page from the 8 paged Tif. I wasn't sure what approach would work best, but it looks like I'll be using LibTiff for this solution.
Thanks for all your help. I really appreciate it.
Matt
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Resizing huge images failing
Is your temp directory already too full to allow processing of your file or have some limit set for it? I am not an expert on this, but thought you might check your temp directory to see that it is not overly full or getting too full while processing.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Resizing huge images failing
What version of Libtiff is IM using on your system? Do you need to upgrade it?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Resizing huge images failing
But you had:matt1008 wrote:My D drive has 400GB free and that's where I'm loading and saving.
If there isn't space in real memory for pixels, they are put in a large file there.matt1008 wrote:-define registry:temporary-path=c:\temp
Yes and yes.matt1008 wrote:The "8" represents 4 channels at 2 bytes each? If I used Q8 it would take half the space?
snibgo's IM pages: im.snibgo.com
Re: Resizing huge images failing
I changed the script to D:\Temp folder and did my load and save from there. It got farther but eventually error-ed out with "unable to extend cache". The main difference between the two approaches is I'm not loading the highest resolution, I'm cycling thru them and loading a much smaller one. The image has 8 resolutions (called directories). I found some code to save a directory to a tif, so I was able to extract the resolution I wanted instead of resizing to get it.
Can ImageMagick extract a specific resolution from a mulit-resolution tif? Now that would be cool. Thanks for your help!
Can ImageMagick extract a specific resolution from a mulit-resolution tif? Now that would be cool. Thanks for your help!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Resizing huge images failing
IM (may or may not) see the multiple resolutions as different images.
Try:
If there is only one line of output, then IM sees only one image. But there may be multiple lines, one per resolution, so you can convert the one you want, eg:
The LIBTIFF toolset, available for Windows from Cygwin, generally read tiff files serially rather than attempting to read the entire image into memory. For example, tiffcrop might successfully break a huge tifff file into pieces. And those tools may understand multi-resolution data that IM doesn't understand.
Try:
Code: Select all
identify Huge.tif
Code: Select all
convert Huge.tif[3] out.tif
snibgo's IM pages: im.snibgo.com