# Texture converter

{% hint style="warning" %}
This tool is no longer maintained.
{% endhint %}

{% hint style="info" %}
This page is about the **Visual Basic .Net** version of the tool. If you want to read about the more recent Visual Basic .Net Framework based iteration, head over to the [Texture converter (VB.Net Framework)](https://mrcmodding.gitbook.io/home/vbnetframework/texture-converter) page.
{% endhint %}

## Features

* Convert images to PAA texture format
* Convert PAA to PNG format
* Do conversion in both directions simultaneously
* Run conversions concurrently

The [Arma 3 Tools](https://store.steampowered.com/app/233800/Arma_3_Tools/) have a very similar application called [ImageToPAA](https://community.bistudio.com/wiki/ImageToPAA). While ImageToPAA is a solid program, it only supports conversion to PAA, and not **from** PAA. The Texture converter was mainly written to address this lack of feature. Otherwise it has a very similar interface and set of features.

### Loading files

<figure><img src="https://3093199008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW202g4rqtsk2O6cTvlfr%2Fuploads%2FBYktFHnvmvq2TG6dNgwW%2Fimage_5_1.png?alt=media&#x26;token=3cba649c-1584-41e9-acb0-3848f3558456" alt=""><figcaption></figcaption></figure>

The UI accepts files on 2 main ways:

* Add source folder button:
  * a folder can be selected, from which all contained files are loaded (subdirectories are scanned if the setting is enabled)
* Drag and drop:
  * multiple files and/or folders can be dropped onto the list view area

When files are loaded into the list to convert, only those files are considered that have one of the extensions enabled for inclusion.

#### Conversion list

The loaded files are displayed in a list view with a set of informative fields:

* **Name:** file name without extension
* **Type:** file extension
* **Path:** full path to the file
* **Size:** file size on disk
* **Resolution:** texture resolution (resolution of the 1st mipmap in case of PAA)
* **Suffix:** texture type indicator suffix (eg: `CO`, `CA`, `NOHQ` etc.)
* **Estimate:** estimated time necessary for conversion

{% hint style="info" %}
The estimated conversion time is based on the file size being divided by an approximate bytes/seconds conversion speed derived from tests during development, therefore it is only an informative value, the true time may differ.
{% endhint %}

#### File validation

Each file is ran through a rudimentary validation. Validation exists to make sure that files are actually in the supported formats, the pixel formats are acceptable by the converter, and the file names conform to the naming conventions.

If a file fails at one point in the validation, an entry is added to the log area with information, and the file is not enabled for conversion by default (it is still possible to force it through manually, in case the validation produced a false negative for some reason).

### Conversion

The actual image conversion is done by the **Pal2PacE.exe** of the **Arma 3 Tools**, so the program makes calls to that executable either one by one, or in a concurrent batch, according to the preferences.

The converted files are either placed back into the source folder, or into a custom output folder.

If a file could not be converted, an error message is added to the log.

## Preferences

<figure><img src="https://3093199008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW202g4rqtsk2O6cTvlfr%2Fuploads%2FcEqI9R8TmIis9giK3XXo%2Fimage_5_2.png?alt=media&#x26;token=9d6af2e1-2bea-4a71-bce1-3f7b9e0f46f7" alt=""><figcaption></figcaption></figure>

* **Pal2PacE:** path to the Pal2PacE executable (the program attempts to locate it automatically through registry at the first run)
* **Process scheduling:**
  * **Progressive:** textures are converted one at a time, process can be stopped, relatively slow, but easy on memory
  * **Concurrent:** textures are converted in a batch, the process cannot be stopped, considerably faster with high file count, but harder on memory usage
* **Timeout:** timeout threshold for conversion processes in seconds

{% hint style="danger" %}
The concurrent conversion effectively calls the Pal2PacE executable as many times simultaneously as many files are to be converted. This can eat up memory resources very quickly with large file quantities. Use with caution!
{% endhint %}

## Environment

* Logic: Visual Basic .Net 5.0
* GUI: Windows Forms

## Requirements

* .NET 5.0
* [Arma 3 Tools](https://store.steampowered.com/app/233800/Arma_3_Tools/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mrcmodding.gitbook.io/home/vbnet/texture-converter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
