DDS Converter
A Java™ Web Start utility for converting PNG and JPEG images into the DDS format required by Civilization 5 mods.
How To Start The Utility
- Click on the Launch button above. If you do not have JDK 7 or later installed you will be directed to the install page.
- Tick to accept the risk and then click the Run button (see Scary Warnings below).
How To Convert An Image
- Click on the "Images" tab (if necessary) and then click the "Choose image ..." button
- In the warning dialog, tick the "Always allow this action" box and then click the "OK" button
- In the open dialog, browse to the required sub-directory, select the PNG or JPEG file and then click the "Open" button
- From the "Select image type ..." drop-down select the desired output format
- If the image is not the correct size already, select the required image manipulation option
- Resize and Clip - the image will be stretch/squeezed equally in both directions until both dimensions are at least equal to the required dimensions and then trimmed to the final size
- Resize Only - the image will be stretch/squeezed in both directions until the required dimensions
- Clip Centre - the image will be trimmed to the required dimensions, if the image is smaller than required it will be centred on a white background
- Clip Manual - a box is displayed over the image of the target size. Drag the box to select a different part of the image to use.
- Use As Is - only available for custom images, the original image will be used unaltered. If this option is unavailable for a custom image, either or both dimensions are not a multiple of 4, in which case Clip Centre will trim a few pixels to reduce the image dimension(s) to a multiple of 4
- Select the desired DXT/BC compresion format - unless your image has specific requirements you shouldn't need to change the default
- Click the "Save image as DDS ..." button
- In the warning dialog, tick the "Always allow this action" box and then click the "OK" button
- By default the DDS image is saved in the same sub-directory as the original with a .dds extension, change these if required, then click the "Save" button.
How To Manually Clip/Resize An Image
- When the selected image is larger than the choosen target format, the "Clip Manual" button is active.
- Select the "Clip Manual" option, the full image will display. The border of the image will be faded out leaving a central window the size of the target format.
- Move the mouse over the image and into the window, the cursor will change to a hand icon.
- Click and hold the left mouse button, as the mouse is moved the window will reposition to show the portion of the original image that will be used for the target image. When the window is over the desired portion of the image to use, release the left mouse button.
- By default, the target image is not scaled from the original. To use a smaller or larger portion of the original image and scale it to the target format size mve the cursor over the bottom right hand corner of the window, the mouse cursor will change to a 4-way arrow.
- With the cursor as a 4-way arrow, click and hold the left mouse button, as the mouse is moved the window will change size. The bottom left corner will not exactly follow the mouse cursor as the aspect ration of the target format is maintained. When the window is the desirde size, release the left mouse button.
How To Convert An Icon
- Click on the "Icons" tab (if necessary) and then click the "Choose icon image ..." button
- In the warning dialog, tick the "Always allow this action" box and then click the "OK" button
- In the open dialog, browse to the required sub-directory, select the PNG or JPEG file and then click the "Open" button
- From the "Select icon type ..." drop-down select the type of icon this image is for
- If the image is not the correct size already, select the required image manipulation option
- Resize and Clip - the image will be stretch/squeezed equally in both directions to fit the port-hole
- Clip Only - the image will be trimmed to the port-hole
- Select the desired icon sizes - provided you selected the correct icon format, these shouldn't need changing
- For SV icons, it is recommend to generate "mipmaps" (pre-scaled versions of the image) and this option is automatically checked. In most circumstances you should not need to change this setting from that automatically selected.
- Click the "Save icon as DDS ..." button, the utility will display a progess dialog as it generates the required icon sizes
- In the warning dialog, tick the "Always allow this action" box and then click the "OK" button
- By default the DDS icons are saved in the same sub-directory as the original with a suffix of the icon size and a .dds extension, change these if required, then click the "Save" button. You will need to do this for each icon size generated. Icon DDS files are saved in the RGBA8 format, unless mipmaps are required in which case they are saved in the DXT1 format.
How To Create An Icon Atlas
- Open a number of Icon tabs and load the required images
- From the "File" menu, select "Add Atlas"
- Set the required number of rows and columns from the drop-down under "Grid Size"
- For each position in the grid, select the required icon (if any)
- Click the "Save atlas as DDS ..." button, the utility will display a progess dialog as it generates the required atlas sizes. Note, as the atlas files get very large very quickly, you may need to save the files in "batches", eg, for units, generate the 45, 64 and 80 sizes, then the 128 size and finally the 256 size.
- In the warning dialog, tick the "Always allow this action" box and then click the "OK" button
- By default the DDS atlas files are saved in the same sub-directory as the original icons with a name of "{Type}Atlas_{Size}.dds", eg UnitAtlas_128.dds, change this if required, then click the "Save" button. You will need to do this for each icon size generated. Atlas DDS files are always saved in the RGBA8 format.
Supported Image Types
The utility can open any PNG, JPEG or GIF format file and most standard DDS files. It can't handle a few obscure DXT compression variations nor the special format DDS files from the Civilization .fpk resource files that have an associated "-index.dds" file.
Special Thanks
- Nasa World Wind - for the DXT compression library
- Java DDS ImageIO Plugin - for the DXT decompression library
- Rob (R8XFT) @ CFC - for testing and suggesting improvements and enhancements
Scary Warnings
Java Web Start applications have to be signed. For the same cost as a one-year personal code signing certificate from a 3rd party authority I can keep this site running for over five years - so that's just not going to happen! The application is therefore "self-signed", hence the scary warning about a risk to your computer. To confirm that this application is the one I signed, see below
Screen Shots
In the "Security Warning" popup dialog box, click on the "More Information" link
In the "More Information" popup dialog box, click on the "View Certificate Details" link
In the "Details - Certificate" popup dialog box, click on the "Subject" field and confirm the entries are as shown
Click on the "MD5 Fingerprint" field and confirm the value is as shown
Providing the Subject and MD5 Fingerprints match this is my certificate (unless someone has managed to hack my iPage account as well), so close the dialogs, check the box to accept the risk and click the Run button.