Koja Scripts
Cloth Tool

Texture Optimization

Hand-made clothing packs are usually bloated and full of textures the game doesn't like — odd sizes, no mipmaps, wrong compression.

Texture Optimization

Hand-made clothing packs are usually bloated and full of textures the game doesn't like — odd sizes, no mipmaps, wrong compression. The Cloth Tool fixes all of that in one action.

What "Optimize" does

Right-click a texture (or a whole item) and choose Optimize. The pipeline:

  1. Decode the source texture to raw pixels.
  2. Resize to power-of-two — the nearest valid size (256, 512, 1024, 2048…). Ties round down.
  3. Recompress to the correct BCn format for the map type.
  4. Generate mipmaps.
  5. Write the result as a managed .ytd inside <project>/assets/.

The status line shows the before → after size so you can see what you saved.

Auto-format selection

The tool picks a compression format from the texture's content and name:

TextureFormatWhy
Diffuse, no alphaBC1 (DXT1)Smallest; alpha not needed.
Diffuse, has alphaBC3 (DXT5)Keeps the alpha channel.
Normal map (_n / _normal)BC5Two-channel, high-quality normals.
High-detail / overrideBC7Best quality where size allows.

You can override the format per texture if you know better.

The managed assets model

  • Imports are copied into <project>/assets/.
  • Optimize rewrites the managed copy — your original files are never modified.
  • This is what makes projects safe to move, rename and share.

Exporting

Need a texture out of the project? Right-click → Export to DDS, PNG or XML — useful for edits in an external image editor or for building store renders.

  • 3D Preview — The centre panel renders your garment on an actual mpmfreemode01 / mpffreemode01 ped, with your real .ytd textures applied.
  • Building — When your project is ready, hit Build and choose the FiveM target.
  • Importing — Select an item and click Import .ydd / .ytd (or right‑click an item → import).
  • Interface — The main window is split into three panels.
  • Items and Textures — An item is one garment or prop.
  • Team Collaboration — The Cloth Tool has Git‑based collaboration built in, so a team can work on the same pack without emailing folders around — and you get a full, restorable history of every change.
  • About the Tool — back to the section overview