Image Swizzling (If not already Implemented) Please read ansca!

Image swizzling is a process that reorders the pixels in an image to make it more adapted to the way the graphic processor reads it. For more information, please read: http://wiki.ps2dev.org/psp:ge_faq.

As a result, images are drawn way faster. But the downside is that the pixels are no more contiguous, making it harder to modify images, because you can’t access a single pixel by its position anymore, but need some quite complicated calculation to find the real reordered pixel position on the image.

So, if you want to access the image data, easily and quickly, you should use unswizzled (normal) images. For images loaded from files that you don’t plan to modify later, you should use swizzled images, as it’s really a lot faster (especially if the image is put in RAM).
If this isn’t already implemented, please please implement it, the performance gains are enormous. (Speaking from experience)

It could either be implemented as a default, or as a extra optional argument to the image functions… ie : display.newImage(“myImage.png”, isSwizzled) – true or false.

Thanks [import]uid: 6981 topic_id: 10880 reply_id: 310880[/import]

Read!

I will bring this up next meeting.

Peach [import]uid: 52491 topic_id: 10880 reply_id: 39605[/import]

Thanks :slight_smile:

If it isn’t already implemented (which i doubt it is) it would be a monumental oversight not to implement it, it’s a relatively easy task to implement also.

Performance gains are HUGE, that cannot be stated enough.

For instance, my app LuaPlayer Euphoria, a engine similar to Corona but for PSP added this a while ago. On a average app, the performance went from 50>60fps to 200>300fps.

[import]uid: 6981 topic_id: 10880 reply_id: 39632[/import]

who exports this format?

C [import]uid: 24 topic_id: 10880 reply_id: 39643[/import]

What format ? It’s an algorithm that re-orders pixel data,…

Did you take a look at the link ?

Has to be done by you guys, it requires low level access that we obviously don’t have from lua. [import]uid: 6981 topic_id: 10880 reply_id: 39667[/import]