A faster way to load multiple images?

I load about 500 images, I crop and resize them, I clone and resize these clones again.

Well all this process is really slow, so I would ask you if actually there is a faster way to do all this (:

Thanks.

What are you doing with the different image renditions?

If you are not drawing them to screen, you might consider not having the ofImage allocate and upload the texture to the GPU. The setUseTexture() doc suggest a new texture will be created and uploaded on each modification of the ofImage. If you are, someone else might have a better suggestion.

(edit: typo)

If you’re not drawing them you might just want to use the ofPixels type since it’s less memory intensive and, as pizthewiz mentions, doesn’t require that a copy of the bitmap data be loaded to the GPU.

1 Like

I need the first loaded for draw the image on screen and his clone (which is a really small image) to calculate his position based on pixel colors.

So, if I follow your suggestion, I should make the images only textures and their clones only cpu pixels? How can I do this? Can I clone an ofTexture in a ofPixel?

Could you clarify what you mean by:[quote=“giampietro_andr, post:4, topic:13918”]
to calculate his position based on pixel colors.
[/quote]

Also, if your images are not being updated frequently, it may speed everything to render all of your image to a single ofFBO and draw that fbo every frame instead of all of the individual textures.

I wrote a program that composes photos like mosaics made of other photos, I use the little images to calculate which photo put where, calculating the matching whit a section of the main image (that also as a “little” version for this), and the “big” version of the images to draw and compose the resulting image (on a FBO (; )