The Forum is up for sale: XeNTaX Forum looking for new owner

Unswizzling images

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Unswizzling images

Post by finale00 »

Any techniques to unswizzling images?
Approaches?

Any libraries that would make it easier? Preferably in python cause I can quickly throw stuff at it and look at the results.

I imagine it boils down to pixel manipulation (for..bitmap images anyways), like just shifting these pixels here, maybe rotating these pixels here and there...adjusting the rgb's...

Looks like a huge puzzle game to me, but I don't have the proper tools to try to solve it effectively.
Like randomly turning a 10x10 rubik's cube hoping to solve it.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Unswizzling images

Post by MrAdults »

One of the most common forms of "swizzling" (twiddling!) you'll find comes from storing pixels or blocks in Morton coordinates. Converting x/y coordinates to Morton is easy: http://permalink.gmane.org/gmane.games. ... thms/15463

Beyond that, it varies between systems/architectures and there isn't another particularly universal standard for the ways in which people like to fuck around with their data to make it easier/faster for them to access under any given condition.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Unswizzling images

Post by finale00 »

Twiddling?

Anyways it looks like python provides a picture module for manipulating pixels. I guess I could play around with that and see where I get.
Vash
mega-veteran
mega-veteran
Posts: 183
Joined: Fri Apr 29, 2005 2:39 pm
Has thanked: 5 times
Been thanked: 26 times

Re: Unswizzling images

Post by Vash »

http://forums.ps2dev.org/viewtopic.php? ... 504bd0dd93

here's an example for the standard psp :)
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Unswizzling images

Post by MrAdults »

Noesis already has rapi.imageUntwiddlePSP, rapi.imageUntwiddlePS2, rapi.imageUntile360Raw, and rapi.imageUntile360DXT. So you don't have to worry about those systems. If you ever come across a new platform standard that it doesn't support, just let me know, I'm always happy to add system-wide stuff like that because that's what helps the most in making life easier.
Post Reply