UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Utility Systems / Texture Resizer System Completed

Utility Systems — UGTK

Texture Resizer System

Summary

An editor-only, destructive batch tool: it scans every Texture2D in the project and rescales the ones whose width or height is not a multiple of 4, overwriting the source file on disk. It exists because most GPU compression formats (DXT, ETC, ASTC) require multiple-of-4 dimensions and silently fall back to an uncompressed format otherwise, inflating build size.

⚠️ Read the caveats before running it. It rewrites your source art. Commit or back up first.


Content


Modules Dependencies

None. A single editor-only class (#if UNITY_EDITOR).


Setup

Nothing to set up and nothing to show in a GIF: no component, no prefab, no scene. Importing the module adds one menu entry:

UGTK ▸ Resize All Textures To Multiple of 4 (Overwrite)


How To Use

Run the menu item. For every Texture2D in the project whose size is not already a multiple of 4 the tool:

  1. makes the texture readable and uncompressed if it is not (re-importing it);
  2. computes the next multiple of 4 for width and height (CeilToInt(size / 4) * 4);
  3. blits the pixels into a RenderTexture, reads them back and encodes to PNG;
  4. overwrites the original file on disk.

Progress and a final count are logged in the console, then the AssetDatabase is refreshed.

What you have to know before running it

In practice: use it on a folder of plain, freshly exported textures, review the diff, and prefer exporting at the right size from the art tool.


Testing Scene

This is an editor tool: there is nothing to play. Test it from Tools > UGTK > Texture Resize (preview).

What to do, in order:

  1. Press Scan the project (read only) and read the two counters: how many textures were examined, and how many are not a multiple of four. Nothing is written yet.
  2. Check a few of them by hand with the ping button.
  3. Commit your work, then run the resize and review the diff.

Step 3 is not a suggestion. The operation overwrites the source files and Unity cannot undo it, so a clean working tree is the only way back. That is exactly why the preview exists: the original menu command rewrote everything with no list shown first.


Technical Info

Path Content
Scripts/Mn_TextureResizeSystem.cs Editor-only class exposing ResizeAllTexturesInAssets() behind the [MenuItem("UGTK/Resize All Textures To Multiple of 4 (Overwrite)")] entry

Namespace: UGTK.UtilitySystems.TextureResizeSystem (note: TextureResize, without the r, unlike the folder TextureResizerSystem). The console messages are in Italian.


© 2026 Marcello De Bonis. All rights reserved