It's a very simple format.
Magic is 3 bytes at 0x0, "TID"
Flags are 1 byte at 0x3, 0x80 is mandatory; others are: 0x1 - big endian header; 0x2 - ARGB instead of RGBA; 0x4 - Morton order swizzling; 0x8 - vertical flip; 0x10 - I've found no use for this
Width is 4 bytes at 0x44
Height is 4 bytes at 0x48
Data size is 4 bytes at 0x58
Format is 4 bytes at 0x64, if it's 0 - it's either RGBA or ARGB (see Flags)
Image data is at 0x80 till EOF
If you want to make a TID, just copy first 128 bytes from existing one and copy your new image data (if you haven't changed width/height/format).
I remember that Vita really
hates RGBA, so set that 0x2 flag and make your image data ARGB. No need to do so for DXT.
Usage for DDS2TID: place your DDS file in the same folder as it's TID source; run QuickBMS; select "neptunia_ideafactory_dds2tid.bms"; navigate and select the DDS file; navigate and select the same folder (input folder is the output folder).