Loading HD images

I tried loading images of up to 4 MB, but unable to render. However, when i load low resolution quality of the same image, it loads. Does cinder have image size limitation?

attached is the line of code used for the same:

mImage = gl::Texture2d::create(loadImage(loadAsset(“1.jpg”)));

In draw function:

Hi Rachanaa,

Is the problem during the loading or the rendering? Can you create a cpu representation of the big image (ci::surface)?
Also check if you are using 8bit or 16bit image file…

Last thing, It could depend on opengl, check the max texture size allowed in your system:
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize_);



Cinder does not have a limitation on image size, but your GPU does. As @dashandslash is saying, you can query the GL_MAX_TEXTURE_SIZE to find the maximum resolution for a texture, which is often at least 16384x16384. Besides this limitation, there’s a limit to the amount of memory your GPU has. For most modern discrete GPU’s this is at least 2GB. Remember that a large portion of the memory is used by the two main render buffers for our window and of course the meshes, shaders and textures.

Also remember that a JPEG image is using compression and therefor it’s only 4MB on disk, but requires much more memory when decompressed. For example, a 1024x1024 RGB image may only require a few hundred KB on disk, but requires 1024x1024x3 = 3MB when decompressed in memory.

If you can’t figure out why the image is not loading, maybe you can share the image file with us so we can see what may be wrong?