Implementing a coder for the TIM2 format
Posted: 2019-05-14T03:05:29-07:00
Hello everyone,
Firstly, I'd like to thank all the devs for their immense work making an awesome image processing package.
I've recently been into disassembling PS2 videogames. This has gone mostly alright, but PS2 games use the TIM2 format for storing images and textures. After searching the internet for decoders, the only ones I found were a proprietary program and an undocumented abandoned github repo. I also found that ImageMagick has a coder for the TIM format, which is the one used by PSX games. So I decided to contribute to the FOSS ecosystem by implementing a coder for TIM2 in ImageMagick.
I've only implemented the read function, and so far I've achieved great results opening most images. It even does better than the proprietary version in some cases. For example, it can handle alpha channels and different versions of the format, which the proprietary version can't.
There are some features that haven't been implemented, mostly because I haven't found any images that use these features, mainly mipmaps and multiple-scene files.
What I'm most uncertain about is the legality of all this. I suppose that if TIM is implemented, then TIM2 would have no issue, but I'd like to be sure of this.
You can find the implementation at:
https://github.com/Qjammer/ImageMagick/tree/TIM2
I am open to suggestions, recommendations, critique, etc if you have any. I'll probably open a pull request pretty soon if there are no major issues with the code.
Please, feel free to comment with your opinion, and thanks for reading!
Firstly, I'd like to thank all the devs for their immense work making an awesome image processing package.
I've recently been into disassembling PS2 videogames. This has gone mostly alright, but PS2 games use the TIM2 format for storing images and textures. After searching the internet for decoders, the only ones I found were a proprietary program and an undocumented abandoned github repo. I also found that ImageMagick has a coder for the TIM format, which is the one used by PSX games. So I decided to contribute to the FOSS ecosystem by implementing a coder for TIM2 in ImageMagick.
I've only implemented the read function, and so far I've achieved great results opening most images. It even does better than the proprietary version in some cases. For example, it can handle alpha channels and different versions of the format, which the proprietary version can't.
There are some features that haven't been implemented, mostly because I haven't found any images that use these features, mainly mipmaps and multiple-scene files.
What I'm most uncertain about is the legality of all this. I suppose that if TIM is implemented, then TIM2 would have no issue, but I'd like to be sure of this.
You can find the implementation at:
https://github.com/Qjammer/ImageMagick/tree/TIM2
I am open to suggestions, recommendations, critique, etc if you have any. I'll probably open a pull request pretty soon if there are no major issues with the code.
Please, feel free to comment with your opinion, and thanks for reading!