Loading 281MB texture causes blender to use 30GB of RAM?

I have Blender 2.8, default cube scene, nothing different, then add image texture node, browse for a 281MB .jp2 image, RAM usage climbs to 22+GB and then Blender crashes. It’s stuck on the browse screen after hitting the Open Image button.

With a 268MB .jpg image, I can browse no problem, no delay after hitting Open Image. Then when I render the default cube scene with the 268MB JPEG texture, it maxes out my 32GB of RAM and Blender crashes.

I don’t understand why blender uses over 20GB of RAM, just for a default cube and one <300MB texture. Are there any settings I can change?

280 mb is a damn big .jpg

What is the resolution?

not sure but I would split the cube into separate objects and split the JPG into those parts and not go over 16384x16384 or 8192x8192 per texture

1 Like

65k… i was trying jpeg2000 because normal jpeg cant handle more than 65k

the animation is a camera flying closer and closer to the moon. i guess if i have to, ill use a lower resolution for the moon at a distance, then as the camera gets closer, just change the material for the part of the moon still in view with higher pixel density.

i was just wondering if there was another way.

This is just a guess, but image formats have to be decoded before they can be displayed. I think that in most cases their size on disk is smaller than the size they take up in memory after being decoded (please correct me if I’m wrong). What program did you use to save this 65k jpeg? How much memory does that program use when you view the image in it?

It is not a 300MB texture, it is 300MB jpeg. Blender have to load that texture = decrypt jpeg to bitmap or in other words decompress texture and only if that successful it can do something further with that, like compression for rendering purposes (blender doesn’t do that) etc.
If I’m right 64k*64k image @24bpp is 12GB, but decompression process does use some amount of ram per block.
Jpeg library used to open jpegs is not made by blender and i guess that nobody designed it for such huge bitmaps.

Yeah, I’d break that down into levels of detail based on how close the camera gets to the surface.

this is the reason procedural shaders will always be king

For something like a scan of the moon I don’t see how you could just use a procedural texture.

You could certainly add some micro detail procedurally, but raster based images are mandatory.