View Full Version : Opening very large images on a RAM-limited machine: can it be done?
Chainmax
27th April 2006, 17:29
I have a very large TIFF image (1xxxx X 1xxxxx, can't recall exactly) that I can't open on my machine with 256MB RAM. I was wondering if there was any trick I could use in Avisynth to open it and what resizer at which settings to use in order to reduce it to 2xxx X 2xxx.
buzzqw
27th April 2006, 19:16
what about setmemorymax and reduceby2().reduceby2() ?
BHH
Chainmax
27th April 2006, 19:46
I know about SetMemoryMax, but like I said I only have 256MB RAM. My image is 400+MB in size. Besides, I doubt reduceby2 is a good resizer compared to Lanczos, Bicubic or Spline.
lexor
27th April 2006, 21:04
what do you mean you can't open it? if you don't have enough RAM your OS should stick it into page file on HDD. Thus only loading parts that are currently needed into RAM.
Chainmax
27th April 2006, 21:44
It gives me some kind of virtual memory error.
unskinnyboy
28th April 2006, 02:38
So you are OK with opening it at 2xxx X 2xxx? In that case, you can run a batch resampler [many image editors have batch processing, Irfanview is one of them which I commonly use - and you can use Lanczos in it] on it first to reduce the resolution even without opening it. Once you get the resampled image saved on the hard drive, you should be able to open it even without AviSynth.
Chainmax
28th April 2006, 04:04
The source image is a 1200dpi scan of a caricature someone drew in college like 10 years ago, and the paper is in bad shape, so this scan is a "master" of sorts. The 2xxx X 2xxx image would be kept in my HDD and be the one I'd make all the edits from.
How would I go about doing batch resampling in IrfanView? And are you sure Lanczos would be the appropriate choce for such a downsizing?
unskinnyboy
28th April 2006, 04:51
How would I go about doing batch resampling in IrfanView? And are you sure Lanczos would be the appropriate choce for such a downsizing?Refer this (http://forum.doom9.org/showthread.php?t=101494) thread where I have given the instructions for setting up batch resizing for someone. In your case, instead of doing resizing, do resampling which would give better quality.
So in step #3 in that thread, the command line should be:
i_view32.exe D:\sourcepath\bigimage.tif /resample=(200,200) /aspectratio /Lanczos /convert=D:\destpath\smallimage.tif
The /aspectratio parameter will ensure that aspect ratio is maintained while keeping both height and width to be <= 200. Tweak the command line as needed.
If not for Lanczos, what else do you have in mind? Irfanview doesn't have a lot of filters to choose from and the other available ones (Hermite, Triangle, Mitchell etc) are inferior to Lanczos. Some advanced image editors (e.g. Photoshop CS) may have more filters.
EDIT: Also, once you have Irfanview installed, have a look at the file i_options.txt inside the Irfanview directory for more details on the command line options.
Chainmax
28th April 2006, 05:26
I've seen Lanczos ring when doing big upsampling jobs and assume it does the same on big downsampling jobs. Is that correct? If so, is there a freeware image editor with neutral bicubic resampling I can use for this task?
foxyshadis
28th April 2006, 06:05
irfanview has many different resizers, so does imagemagick (more command-line, joy). But downsampling doesn't really ring - all kernel resizers work the same way and have the same upsizing artifacts, with slight variation, and spline/fractal/vector resizing is overkill (and too memory intensive) for downsizing. Lanczos and bicubic just give an effect similar to a slight unsharp mask, stronger in lanczos's case.
I think you're going to find that even batch resizers and command-line tools will first buffer the image in memory, so maybe you should just crank your virtual memory up to 2 gigs and leave it running overnight (and hope it doesn't kill the hard drive...). Or just put it on a cd and have someone with too much ram for their own good do it for you.
I'm sure there must be something designed to process images piecewise, but I don't know any offhand.
Chainmax
28th April 2006, 15:49
Yeah, maybe finding someone with at least 512MB RAM will be a better choice. By the way, are you saying that all resizers will give similar results for a downsizing to 20%?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.