Reply to thread
GBAtemp.net - The Independent Video Game Community
Search
Search titles only
By:
Search titles only
By:
Reply to thread
GBAtemp.net - The Independent Video Game Community
Home
Log in
Terms & Rules
Donate
Forums
New posts
Search forums
Groups
Public Events
New
New posts
New resources
New blog entries
New profile posts
New blog entry comments
New threadmarks
Latest activity
Cheats
Cheat Codes Add and Request group
The Legend of Zelda: Tears of the Kingdom cheat codes
Pokémon Legends: Arceus cheat codes
Xenoblade Chronicles 3 cheat codes
Fire Emblem Engage cheat codes
Request a cheat...
Tutorials
Nintendo Switch tutorials
Nintendo 3DS tutorials
Nintendo Wii U tutorials
Reviews
Overview
Official reviews
User reviews
Downloads
Latest reviews
Search resources
Blogs
New entries
New comments
Blog list
Search blogs
Chat
Top chatters
Search
Search titles only
By:
Search titles only
By:
Log in
Register
New posts
Search forums
Log in
Register
Home
Forums
PC, Console & Handheld Discussions
Sony PSP
Phantom Kingdom Portable: English Translation
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Elaugaufein" data-source="post: 5059645" data-attributes="member: 243749"><p>ChepChep sent me some 16 color IMYs , so I've got the IMY decoding totally sorted now. Just need to take care of the re-encoding.</p><p> </p><p>I'll make the code for IMY -> PNG -> IMY available once I get the FakeCompression and reencoding sorted.</p><p> </p><p>For those interested 0x00 - 0x1F is Header.</p><p>0x00 - 0x02 is file type signature: IMY in ASCII</p><p>0x04 - 0x06 is unknown data that seems to be related to the content (0x03 and 0x07 may be included in this but I haven't seen any files where they are non-00 yet)</p><p>0x08 - 0x09 is Width stored little Endian (for a 16 color image the final width is twice this value but that's done after pixel deinterlacing)</p><p>0x0A - 0x0B is unknown data (A4 04 appears to indicate that an IMY has multiple sections contained in it e.g icons, fonts ,etc) A4 08 seems to indicate an IMY is a single image)</p><p>0x0C - 0x0D is Height stored little Endian</p><p>0x0E - 0x0F is number of Palette colors stored Little Endian (16 or 256)</p><p>0x10 - 0x1F appeas to be all 00s</p><p>For 16 color palette</p><p>0x20 - 0x5F is Palette</p><p>For 256 color palette</p><p>0x20 - 0x0419 is Palette</p><p>In either case these are RGBA8888 colors, stored Big Endian</p><p>After the palette the next 2 bytes are either the jump offset from the end of those bytes to the start of the compressed data or 00 indicating that the following 4 bytes contain the jump offset from the end of those 4 bytes (stored Little Endian in either case, I may be wrong on the second part, since the assembly code there seems to be a very complicated way of doing that, so my byte ordering may be a little out)</p><p>After that is a sequence of 1 byte command blocks (use 1-16 half words of uncompressed data, a reference to an already decoded half word neighbor on the previous row or to the left (since the other neighbors aren't known), or a reference to 1-16 key blocks (either stored after the instructions and before the uncompressed data or referring to previous nearby uncompressed data, there's a limit on how far back you can go since the command block also sets the negative offset). Commands are processed until the output is equal to height x width (so there's no need for a terminating command).</p><p>After that is the key blocks (optionally)* , followed by uncompressed data.</p><p> </p><p>*I'm not sure if key blocks are ever actually used or if that command only ever refers to nearby uncompressed data but it's theoretically possible (my gut feeling is that its probably not used, since storing the first instance as uncompressed data and then referencing that seems to always be at least as efficient).</p><p> </p><p>After the data is decompressed , pixels have to be deinterlaced (Skyblade describes this on page 5 and his code is exactly correct). The color palette doesn't seem to be interlaced though , it seems to be stored in standard PNG palette format, so I think he made a mistake somewhere on that one.</p><p> </p><p>In the case of 16 color / 4 bitDepth images , there's one more step: Each "byte" is actually 2 pixels consisting of 4 bits each, stored "Little Endian" , and the width is double that given in the header , so the width needs to be double and each byte translated into 2 bytes each containing the equivalent of a 4-bit value (since palette indexes in a PNG are always 8 bits even if the palette is only 16 colors).</p></blockquote><p></p>
[QUOTE="Elaugaufein, post: 5059645, member: 243749"] ChepChep sent me some 16 color IMYs , so I've got the IMY decoding totally sorted now. Just need to take care of the re-encoding. I'll make the code for IMY -> PNG -> IMY available once I get the FakeCompression and reencoding sorted. For those interested 0x00 - 0x1F is Header. 0x00 - 0x02 is file type signature: IMY in ASCII 0x04 - 0x06 is unknown data that seems to be related to the content (0x03 and 0x07 may be included in this but I haven't seen any files where they are non-00 yet) 0x08 - 0x09 is Width stored little Endian (for a 16 color image the final width is twice this value but that's done after pixel deinterlacing) 0x0A - 0x0B is unknown data (A4 04 appears to indicate that an IMY has multiple sections contained in it e.g icons, fonts ,etc) A4 08 seems to indicate an IMY is a single image) 0x0C - 0x0D is Height stored little Endian 0x0E - 0x0F is number of Palette colors stored Little Endian (16 or 256) 0x10 - 0x1F appeas to be all 00s For 16 color palette 0x20 - 0x5F is Palette For 256 color palette 0x20 - 0x0419 is Palette In either case these are RGBA8888 colors, stored Big Endian After the palette the next 2 bytes are either the jump offset from the end of those bytes to the start of the compressed data or 00 indicating that the following 4 bytes contain the jump offset from the end of those 4 bytes (stored Little Endian in either case, I may be wrong on the second part, since the assembly code there seems to be a very complicated way of doing that, so my byte ordering may be a little out) After that is a sequence of 1 byte command blocks (use 1-16 half words of uncompressed data, a reference to an already decoded half word neighbor on the previous row or to the left (since the other neighbors aren't known), or a reference to 1-16 key blocks (either stored after the instructions and before the uncompressed data or referring to previous nearby uncompressed data, there's a limit on how far back you can go since the command block also sets the negative offset). Commands are processed until the output is equal to height x width (so there's no need for a terminating command). After that is the key blocks (optionally)* , followed by uncompressed data. *I'm not sure if key blocks are ever actually used or if that command only ever refers to nearby uncompressed data but it's theoretically possible (my gut feeling is that its probably not used, since storing the first instance as uncompressed data and then referencing that seems to always be at least as efficient). After the data is decompressed , pixels have to be deinterlaced (Skyblade describes this on page 5 and his code is exactly correct). The color palette doesn't seem to be interlaced though , it seems to be stored in standard PNG palette format, so I think he made a mistake somewhere on that one. In the case of 16 color / 4 bitDepth images , there's one more step: Each "byte" is actually 2 pixels consisting of 4 bits each, stored "Little Endian" , and the width is double that given in the header , so the width needs to be double and each byte translated into 2 bytes each containing the equivalent of a 4-bit value (since palette indexes in a PNG are always 8 bits even if the palette is only 16 colors). [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
PC, Console & Handheld Discussions
Sony PSP
Phantom Kingdom Portable: English Translation
General chit-chat
Help
Users
Settings
Notifications
Miscellaneous
Inverse message direction
Display editor on top
Enable maximized mode
Display images as links
Hide bot messages
Hide statuses
Hide chatter list
Show messages from ignored users
Temporarily disable chat
Receive mention alerts
Sound notifications
Normal messages
Private messages
Whisper messages
Mention messages
Bot messages
Desktop notifications
Normal messages
Private messages
Whisper messages
Mention messages
Bot messages
Options
Options
View top chatters
Psionic Roshambo
Loading…
Xdqwerty
Loading…
what are you looking at?
MysticStarlight
Loading…
pball79
Loading…
@
Xdqwerty
:
@SylverReZ
, so you like retro stuff since you were a kid
+1
Yesterday at 11:52 PM
@
SylverReZ
:
@Xdqwerty
, Yes, ever since I was born. Into computers and game consoles.
Yesterday at 11:53 PM
@
SylverReZ
:
I had a PS1, PS2, Wii, and many more that takes longer to list without scowering through my stuff, just to name a few.
Yesterday at 11:53 PM
@
Xdqwerty
:
@SylverReZ
, i recall using the internet since i was about 4 yrs old (mainly just to watch YouTube and play browser games)
Yesterday at 11:54 PM
@
Xdqwerty
:
And yea I had a PS2 and a 3ds too but you know what happenned to them
Yesterday at 11:54 PM
@
SylverReZ
:
@Xdqwerty
, What happened?
Yesterday at 11:54 PM
@
Xdqwerty
:
@SylverReZ
, both broke, and my PS2 was sent to be repaired but we never got it back
Yesterday at 11:55 PM
@
Xdqwerty
:
I though you already knew about my 3ds tho
Yesterday at 11:55 PM
@
Xdqwerty
:
Btw
@SylverReZ
do you remember this video?
Today at 12:00 AM
@
SylverReZ
:
No
Today at 12:01 AM
@
SylverReZ
:
I'm off to bed, have a good night.
Today at 12:01 AM
@
Xdqwerty
:
@SylverReZ
, sleep well
+1
Today at 12:03 AM
@
K3Nv2
:
Yawn
Today at 12:52 AM
@
Xdqwerty
:
@K3Nv2
, no
Today at 1:02 AM
@
K3Nv2
:
wut
Today at 1:05 AM
@
Xdqwerty
:
@K3Nv2
, stfu
Today at 1:14 AM
@
K3Nv2
:
what's that
53 minutes ago
@
PandaPandel
:
panda spotting in chat
34 minutes ago
@
Xdqwerty
:
I'm getting sleepy even though it's fairly early
28 minutes ago
@
pball79
:
Hey guys, where's the post that has all the wii u themes?
26 minutes ago
@
MysticStarlight
:
There are two
14 minutes ago
@
MysticStarlight
:
https://gbatemp.net/threads/share-and-download-custom-wii-u-themes.592318/
14 minutes ago
@
MysticStarlight
:
https://gbatemp.net/threads/huevos-vault-wii-u-themes.652387/
14 minutes ago
@
Xdqwerty
:
https://youtu.be/75M8Gnhqta8?si=isAD0lGCEfGTvMhv
11 minutes ago
@
Psionic Roshambo
:
https://www.clickorlando.com/news/f...n-remains-while-searching-for-missing-family/
5 minutes ago
Submit
@
Psionic Roshambo
:
https://www.clickorlando.com/news/florida/2024/06/15/man-arrested-as-florida-deputies-find-human-...
5 minutes ago
Chat
4