Skip to content

Instantly share code, notes, and snippets.

@Drwhocake
Last active March 16, 2025 21:57
Show Gist options
  • Select an option

  • Save Drwhocake/278332c26b54c8130339e9129623fe37 to your computer and use it in GitHub Desktop.

Select an option

Save Drwhocake/278332c26b54c8130339e9129623fe37 to your computer and use it in GitHub Desktop.

How to Compress Textures for Fivem / GTA 5

Asset textures often need to be resized or the compression method changed. Large Sized Textures cause issues for your players such as the map not loading making them fall through the map or other models not loading either. FXServer will warn you in the console if your YTD files are too large.

If you have issues compressing textures, feel free to comment and I’ll try to get back to you.

How to Setup Photoshop for Use with DDS Files

Best way to keep the quality of the file, you are going to resize is to keep the image in a DDS format (DirectDraw Surface) DDS is a compressed format and thus cannot be opened the same way a PNG or JPEG can.

If you want to avoid Setting up Photoshop or you don’t own a licence for Photoshop the alternative is to use Paint.NET as it supports DDS natively and is free

To allow Photoshop to open and edit DDS files you need to install a plugin. There is a few options for this but I highly suggest the Intel Texture Works Plugin.(Nvidia one works but I`ve had problems importing the DDS into openIV after export) Intel Texture Works Plugin comes with instructions on how to install and works nicely with windows as you can then double click DDS files to have them open in Photoshop. For your convenience I have copied the guide from the Intel Texture Works Plugin Repo

Installation guide for Intel Texture Works

  1. Close Photoshop
  2. Download the IntelTextureWorks_1.0.4.zip file and expand it on your local computer
  3. Copy the desired plugin from either of the following unzipped folders
    • .../IntelTextureWorks_1.0.4\Plugins\x64\IntelTextureWorks.8bi
    • .../IntelTextureWorks_1.0.4\Plugins\Win32\IntelTextureWorks.8bi
  4. Paste the plugin into the appropriate Photoshop Plugin folder
    • D:\Program Files\Adobe Photoshop CC 2014\Required\Plug-Ins\File Formats
    • D:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\File Formats
  5. Copy the cubemap scripts from:
    • .../IntelTextureWorks_1.0.4\PhotoshopScripts\IntelTextureWorks-ConvertCubeMap.jsx
    • .../IntelTextureWorks_1.0.4\PhotoshopScripts\IntelTextureWorks-CubeMapGaussianBlur.jsx
  6. Paste the cubemap scripts into:
    • D:\Program Files\Adobe Photoshop CC 2014\Presets\Scripts

.YDR files

In order to resize textures from a YDR container you need to export the images from it first, you cannot edit them within a YDR file. To export from a YDR file my favourite way is to open the file with Texture Toolkit It's really easy to open YDR files with Texture toolkit, the main thing to remember with the toolkit is that it can only import, export and save textures a YDR and cannot change the compression method.

You can also open YDR files with OpenIV, just create an archive first to work on and import the YDR files.

You cannot change compression Methods using Texture Toolkit. If you need to change compression you will need to import the image into photoshop and export it again to change the method.

Compression Methods

Here is a list of all the most common compression methods in all cases you will be using DXT5 unless its really basic in-which you will use DXT1:

Compression Algorithm Information
DXT1 For use with really basic and small images (only has basic colour)
DXT5 For use with most images
A8R8G8B8 This method takes up a huge amount of space. Has Little compression. To be used for script_rt_dials_race (dials for vehicles)
A8 pain of death, pretty sure this has no compression involved

You can change the compression methods of YTDs inside OpenIV

  1. Make sure your OpenIV is in Edit mode
  2. Select the image you want to change the method of, in the left bar
  3. Click properties near the top right.
  4. Using the Pixel format dropdown box change the compression method.
  5. Press okay

Image Size

It's important to check image size as 1 4000x4000 image even in DXT5 mode can push a car into a warning. Here is a rough guide of sizes that textures should be.

Item Texture Size Comments
Big Items (liveries) at most 2046x2046 it is okay for it to be sized smaller once it looks okay
Medium Items (big important pieces, engines) 1024x1024
Small Items (Tyres, lights, weapons) 512x512
Really Small Items (logos) 256x256

How to change the size of an image in photoshop

  1. Open the DDS file with Photoshop
  2. Under the Image tab from the top bar select Image size (Alt + CTRL + i)
  3. Change the Height to the appropriate size (make sure you use pixels for measurement). you don't change the width as photoshop will adjust this for you after you change the height! ** If the item is a rectangle it will need to be a rectangle after you resize it. The ratios need to match after the image is made smaller**

How to export a DDS with photoshop

  1. Save image as (shift + control + S)

  2. choose Intel Texture Works (.DDS)

  3. Save in the right Directory

    Options for DDS export

    Texture Type: Color + Alpha
    Compression: BC3    8bpp    (linear)
    Mip level: Ignore (leave blank)
    Pre-compress Normal Map operations: Ignore (leave blank)
    Mip Maps: Auto Generate
    And then press Okay!
    

Now the fun part, Compression!

  1. Create a work folder to place your file.
  2. open your file in OpenIV or in Texture Toolkit if it is a YDR.
  3. Look through all the textures you are looking for Size (pixels), Compression Method and purpose.
  • Size. Size should never be above 2046x2046 it doesn't make sense to have a 4kx4k texture for a car.
  • Compression Method. You are checking that the compression method is DXT5 or DXT1
  • Purpose. The reason you check purpose is because you don`t need a huge texture for a tire or floormat.
  1. Using All the Criteria I have set look through the texture files and adjust every item that does not meet the criteria

References

Writen while a member of the RPUK Development team for RPUK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment