Page 1 of 1

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

Posted: March 7th, 2020, 9:58 am
by ArthCarvalho
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

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

Posted: March 30th, 2020, 7:46 am
by ArthCarvalho
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

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

Posted: October 8th, 2020, 11:19 pm
by Lollie
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.

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

Posted: September 27th, 2024, 4:31 am
by Solidsnake777
I was having some issues with the command line and am completely stuck. I was trying to convert a png to tim, but wanted to mark the bpp as 16 instead and don't know how to post the command line

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

Posted: March 10th, 2025, 3:36 pm
by RonnyMuller
Solidsnake777 wrote: September 27th, 2024, 4:31 am I was having some issues with the command line and am completely stuck. I was trying to convert a png to tim, but wanted to mark the bpp as 16 instead and don't know how to post the command line
Have you fixed it yet, can you appeal to me?