Jump to content

Not Enough Memory to load image


Recommended Posts

I'm a newbie to the tool, so maybe I'm doing something wrong. However, I find it hard to believe I'm RAM constrained in this case.

File = 50.4mb Tif

PC = 2gb RAM (of which with way over 1gb is free, before paging), Core2 Duo 2.66ghz, Vista (64-bit)

Paint.NET = 3.10 (says no updates are available), install is fine since many other smaller images open

Can someone give me a clue.

Link to post
Share on other sites

FWIW...

I re-checked my RAM availability. Two different utilities (in addition to Task Mgr) tell me that I've got 1.2Gb of Free RAM plus about 4.8Gb of Free paging file space

Its not a disk issue either, since I've got 160+GB free.

This problem seems to happen on any/all TIFs over 20mb.

Is this a known limitation, a bug ?

Perplexing.

Link to post
Share on other sites

What's the Pixel Size of the image? It sounds huge.

According to Rick,

Paint.NET's architecture is such that it must:

1) Hold the entire image in memory

2) Have a bitmap used for compositing the image

3) Have a scratch surface

(3) is not always in use, but it's important to have it allocated because it makes error handling much simpler. If you clicked on the Clone Stamp and suddenly got an out of memory error, that would be lame. (2) is not always important, as a single layer image effectively needs no compositing.

So, to compute the memory requirements for an image, the following formula can be used:

(W x H x 4) x (L + 2)

W is the width of the image in pixels, H is the height in pixels, 4 is because each pixel takes 4 bytes, L is the number of layers, and the +2 accounts for (2) and (3) above.

So for your 7680x2880 image, which I assume has 1 layer, the total memory required is:

(7680 x 2880 x 4) x (1 + 2)

= (88473600) x (3)

= 265,420,800

= 253.125 MB RAM

When you resize an image, you must have enough memory to hold the image at both its old and new sizes. Other factors influence how much memory is available. For instance, just because there is still 1 GB of virtual address space available does not mean that there is 1 GB available contiguously.

Programs like Photoshop and The GIMP have complicated memory managers that tile the image, swapping it out to scratch pads (disk) as necessary. This impacts coding complexity because every part of the application that works with the image must take the tiling in to consideration. It also affects performance, but has the advantage of being able to work with much larger images. For Paint.NET, I purposely chose a design that enabled coding simplicity for many reasons.

If you have a 64-bit CPU and OS, you will have a much harder time running out of memory. You may also look into the /3GB switch for the boot.ini file, although I do not know for sure that this will help: http://support.microsoft.com/default.as ... E05B0ABAAA

So...two gigs probably won't be even close to enough if it's an image with a massive pixel size.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to post
Share on other sites

Most TIF's that users report problems with are 1-bit black-and-white images. Paint.NET always converts these to 32-bit, and so your 50mb TIF probably requires -- after decompression and conversion -- about a billion million megabytes of memory. That is simply the way Paint.NET currently works.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to post
Share on other sites

David: Thanks for the response and education.

We're at the outer limit of my graphics knowledge. I'm not a graphic artist. I just got volunteered to build a mockup of a book for use by the publisher/author. (Lesson learned, never do favors for relatives who are authors.)

All I can tell you for sure is that I scanned the sucker as a 16bit Grayscale TIF from an old 8"x10" BW pic from the 1830s. It was scanned to TIF at the publisher's request.

I really have no idea what layers are, let alone if they exist in this pic. I also have on idea of the pixel size. However, I'd guess there is only one flat layer and I think the pixel size is 4530x5831 per Windows Explorer. (If this is correct, then I get 316,973,160 per your (WxHx4)x(L+2)...assuming L=1...formula.) This number equates to about 309.5mb if I did the math right.

So, even with the need to hold 2 copies of the file in ram, I guess I still don't understand why that file would not open when I have 1.2GB free ram plus 4GB of paging file? Perhapsthe free ram is not contiguous...although a couple utilities seem to lead me to the conclusion that over 1GB of it is. Again, probably over my head a tad.

In any event, I'll look into the boot switch and perhaps retest. If it works, I'll let you know.

Thanks for your help/patience with a guy using training wheels.

Rick: Thanks for the reply. I thought it must be an architectural issue. I'm not sure, but assume that since I scanned it as 16-bit grayscale, that it is not a 1-bit. However, point taken...maybe the program converts 16 to 32bit as well...perhaps doubling the file size requirments?

The bottom line is that since posting the question, I have installed/tested GIMP and have been able to easily open the file (and other larger ones) using GIMP on the same PC. Once open (and since I'm not going for high-quality, just a rough mockup) I turn right around and save it as jpg at a lower quality. One new graphics program is plenty to try learning at the moment, thank you very much. :lol:

I guess I should have scanned to 2 formats (one lo-res jpg for mock-up and 1 hi-res TIF for the publisher). However, there are 300 of these things and it was my first time over this hill. So I went for the "1 format fits all needs" method to save myself scanning hours. (Another lesson learned...pay me now or pay me later.)

Both:

Your product is much more intuitive than GIMP, Photoshop, etc. For me, a newbie who just wants to thrash through 300 pics and make them decent enough to print on my 600dpi laser, it was a godsend to be able to open files crop/adjust and save them...sans training/manual/help file. I've really enjoyed using your tool. Thanks for the tool and response. You guys do great work!

Link to post
Share on other sites
David:

Unfortunately the /3gb switch did not work. FYI, for vista users here is a link to the instuctions (Vista has no boot.ini).

http://blogs.technet.com/brad_rutkowski/archive/2006/10/03/Hey-where-did-_2F00_3GB-go-in-Longhorn-and-Vista_3F00_.aspx

Actually, we've reached the end of my knowledge, too. I understand what I posted, but I don't know anything about the paging file, the switch....nothing, really. Sorry, but this is a question for Rick. :-/

Good luck!

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...