1. For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    Dismiss Notice

Tool TConvert - Extract content files and convert them back

Discussion in 'Released' started by trigger_segfault, Sep 3, 2017.

  1. trigger_segfault

    trigger_segfault Terrarian


    A combination tool for managing Terraria content resources. Extract from Xnbs, convert to Xnbs, backup, and restore. The unofficial sequel to TExtract.

    Suppots: Images, Sounds, Sprite Fonts, ReLogic's Dynamic Sprite Fonts, and Wave Banks

    [​IMG] [​IMG] [​IMG] [​IMG] [​IMG]



    (This preview has been sped up)



    ~ Extract image, sound, and font resources from Terraria's Xnb files, and extract songs from Terraria's Xwb wave bank ~
    ~ Convert images and sounds back into Xnb format and copy them to the content directory ~
    ~ Backup and restore your content folder for when you need to remove changes (Glorified file copier) ~
    ~ Run scripts that give more control over where files go when they are converted or extracted ~
    ~ Drop files into the window to automatically process them ~
    ~ Command line support for use with Windows Shell or the command prompt ~
    ~ Set paths as "." to use the current directory of the executable ~


    .NET Framework 4.5.2 | Windows 7 or later

    Downloads: v1.0.2.1

    (The main UI-based executable)
    (The pure console-based version of TConvert. Works better on the console but has no UI)

    ~ Previous downloads can be found at the bottom of the page ~


    Script Guides

    How to Write XML
    How to Write Scripts
    Example Script


    Wiki | Credits | Image Album | Source Code


    ⬅ Other Information

    • Program no longer crashes when failing to find the Terraria install directory and trying to extract a Wave Bank.
    • Both now support premultiplying image alpha when converting to XNB. Note: This feature is enabled by default as most users will be expecting it (especially when A == 0 and RGB != Black)
    • Now packaged with the full version of FFmpeg, which drastically increased the file size of the executable.
    • Numerous non-wave audio formats are now supported.
    • Now launches Terraria from the configured save folder in Terra Launcher if present on the computer.
    • A bit of code refactoring.
    • No longer throws an error when encountering comments in xml scripts.
    • Wave Banks can now extract to and from paths with spaces in them.
    • Renamed extracted tracks and TrackList file.
    • Font checkbox in extract tab should properly disable.
    • No more errors related to invalid or null paths.
    • Fixed an outdated error message window using the old program name and not linking to the correct GitHub page.

    The first release. Comes with everything you need to convert and extract Xnb files.
    Last edited: Dec 25, 2018
    Theo, hamstar, AJC0MICS and 7 others like this.
  2. Unftf

    Unftf Terrarian

    Nice! Very useful.

    Correct it can't extract shader? I get some error message:
    Error: Extracting:...amapps\common\Terraria\Content\PixelShader.xnb
    Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
    Error: Extracting: ...amapps\common\Terraria\Content\ScreenShader.xnb
    Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)
    Error: Extracting:..mapps\common\Terraria\Content\TileShader.xnb
    Reason: Xnb error (Unsupported asset type: Microsoft.Xna.Framework.Content.EffectReader.)

    Did you made some change at the image size? E.g. NPC_276.png is 46x842 but has 15 different states. But you cant divide 842 by 15. Last two pixel not needed. Or do you know the reason for those sizes?
    Last edited: Mar 30, 2018
  3. trigger_segfault

    trigger_segfault Terrarian

    Yes, it's correct to say that shaders are not extractable. Whether it's even possible to decompile shaders in the first place is something I'm not sure of.

    No changes are made to the extracted images, they are extracted exactly as they are stored. I guess this is either a simple mistake on Terraria's end, or a buffer to prevent looking outside the image. Other reasons are certainly a possibility.
  4. blahblahbal

    blahblahbal Skeletron Prime

    I just found out that TConvert has a fairly large 'bug' in it. If you use white transparent pixels in a sprite, these pixels are converted to opaque white pixels. What I mean by 'white transparent pixels' is pixels that are fully transparent, but have an RGB value of 255, 255, 255.
  5. trigger_segfault

    trigger_segfault Terrarian

    Whoops. Looks like I forgot to premultiply the alpha. Amusingly enough I just pushed this same fix to png_to_xnb a few months ago. I'll get right on this.

    A basic rundown for those who aren't familiar: Premultiplying alpha is what XNA does by default to images so that they're ready to be drawn without having to multiply the RGB channels by the alpha every time the image is drawn at runtime.

    Edit: And v1.0.2.0 is live with premultiplied alpha (Now the default setting).
    Last edited: Aug 3, 2018
  6. unrealmegashark

    unrealmegashark Terrarian

    I need a Mac version