tips for loading many high resolution images (2048 x 1536) without lag

Hello
I’m doing an app for retina iPad, it’s using around 60 different high resolution image (2048 x 1536).
The images are displayed one by one in a slider similar to iOS photo gallery.
If I try to load images during runtime, the app is freezing for a short duration (1-2 seconds), then nothing looks fluid.
I cant load all the images at the start, there is not enough memory.

Is it possible to load the image in a background thread?
Any suggestion or example using OF?

Thank you

try it
https://github.com/armadillu/ofxFastIOImage

Hello,
thank you for your reply fishkingsin,
In the example ofxFastIOImage is saving images loaded from ofImage into a .bin and .xml in the iPhone directory (which I can’t access), then loading from the iPhone directory it created.
So I would need to convert all my images in a different application before?

Now I’m cutting every images in smaller tiles with this https://github.com/jlamarche/Tile-Cutter
I load all the tile progressively, it’s good the app is not freezing during the loading, though loading an entire image 1536x2048 is 4seconds!

This is the code I’m using

  
void testApp::update(){  
  
int column=16;  
    int row=12;  
      
    tileNum=192;  
    for (int i=0; i<row; i++) {  
        for(int j=0;j<column;j++)   
        {  
            int current=(i*column)+j;  
            if (currentTile==current) {           
            original[current].loadImage("tiled/output_"+ofToString(i)+"_"+ofToString(j)+".jpg");  
                isTileLoaded[current]=true;  
            }   
        }  
    }  
    currentTile++;  
}  
  
void testApp::draw(){  
  
    for (int i=0; i<row; i++) {   
        for(int j=0;j<column;j++)   
        {  
            int current=(i*column)+j;  
            if (isTileLoaded[current]==true) {  
      original[(i*column)+j].draw(j*tileSize,i*tileSize, tileSize, tileSize);  
            }  
        }  
    }  
 }     

On a related note, I’m having real trouble dynamically loading a small number of textures within a small amount of time (e.g. within no more than a few frames). I’ve posted here (http://forum.openframeworks.cc/t/threaded-image-loader/816/15) but it was suggested I check the iOS forum and try jpgs instead of pngs.

As mentioned in my latest reply to the original post, I also tried jpgs but had no joy. Does anyone have any suggestions?

Thanks :slight_smile: