IMG2TIM-EX - Fork of Lameguy's img2tim with new functions.

Downloadable items posted by PSXDEV members are within this forum.
Post Reply
User avatar
ArthCarvalho
Active PSXDEV User
Active PSXDEV User
Posts: 45
Joined: Jan 29, 2016
I am a: Artist, Programmer
PlayStation Model: SCPH-103

IMG2TIM-EX - Fork of Lameguy's img2tim with new functions.

Post by ArthCarvalho » March 7th, 2020, 9:58 am

I've made a fork of Lameguy's img2tim tool that adds detection and conversion of 8-bit images into 4-bit if the palette only contains 16 colors or less.

Has all the same functions as the original, it is based on v0.75.

Github:
https://github.com/ArthCarvalho/img2tim

Download link:
https://github.com/ArthCarvalho/img2tim ... _.v0.8.zip

User avatar
ArthCarvalho
Active PSXDEV User
Active PSXDEV User
Posts: 45
Joined: Jan 29, 2016
I am a: Artist, Programmer
PlayStation Model: SCPH-103

Post by ArthCarvalho » March 30th, 2020, 7:46 am

New release. Now with added support for setting arbitrary color indices as semi-transparent.

Use -sindex to set the semi-transparent bit to a specific color index, note that it`s 0-based index so the first color is 0, the second color is 1 and so on.

You can also use -srange to set a range of colors to semi-transparent.

Now if you're asking, what exactly can you do with the semi-transparent bit? Well, that's simple:
If you set your sprite/polygon with semi-transparency, it will only apply the semi-transparent effect on colors that have this bit set.

There are 3 kinds of "transparency" a texture/sprite can have on the PlayStation: Completely transparent (Black, RGB 0,0,0), Completely opaque (Any other colors with semi-transparent bit set to 0) and semi-transparent, which are colors with the st bit set to 1.

Note that no transparency effect will work on colors that have the transparent bit set to 0, so if you want to fade out your image or use additive/subtractive blending modes, you must set the transparent bit to all colors that are not black/transparent.

If you want to fade out a sprite or texture while using this "mixed" semi-transparent bit mode, you need to prepare two CLUTs in advance where one has only some colors with the semi-transparent bit, and when "fading" you switch to a CLUT with all colors set to semi-transparent.

Download link:
https://github.com/ArthCarvalho/img2tim ... _.v0.9.zip

User avatar
Lollie
Curious PSXDEV User
Curious PSXDEV User
Posts: 10
Joined: Oct 18, 2019
Contact:

Post by Lollie » October 8th, 2020, 11:19 pm

Nice to have a command line tool, thank you for forking this!

Edit: Figured out my issue! Img2Tim-EX requires an indexed 8-bit image in order to automatically detect if it is using 16 colors or less. My image technically used less than 16 colors, but was saved as a 24-bit image.

Original post below -
I'm running into a small issue: I'm trying to use this tool in tandem with Orion's PocketStation Devkit, but "tim2mcicon" returns this error:
Bad TIM file format, must be 4 bits CLUT
I've tried using "-bpp 4" when converting my image to TIM just in case, but it doesn't seem to do the trick.

It's worth noting that Img2Tim-ex is producing a valid TIM — I'm able to make the result conform to a 4-bit CLUT by opening and editing the palette with Tim2View, so I have a workaround. It'd just be nice to be able to totally automate the conversion step.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests