Wednesday, 5 March 2014

Create or edit uklogo.raw with GIMP

You can use the freeware image editing program GIMP to create or edit uklogo.raw for your custom Tomb Raider Level Editor (TRLE) game. Uklogo.raw is the graphic that appears above the menu when the game starts and is usually the game’s title.

Partha’s version of GIMP has Python scripting built in and ready to use in addition to the Script-Fu Scheme scripting that comes standard with GIMP. Scripting is not needed for this tutorial but is fun to try and you may find Python scripting easier.

Creating uklogo.raw


Start GIMP and in the File menu press New. I have set GIMP to single window mode via the Windows menu.

GIMP screenshot

In the Create a New Image dialog, set the width to 512 pixels and the height to 256 pixels. Expand the Advanced Options and make sure the Color Space is RGB color. My foreground colour is black so I chose Fill with Foreground color. Remember that any pure black in uklogo.raw will be transparent in game.

Create a New Image dialog screenshot

A blank canvas to create your logo is created in GIMP.

GIMP screenshot with a new 512 x 256 image

When finished creating your image, check that you have no transparency (alpha) in the image by clicking on the RGB channels info tab shown top right in the following screenshot. Your image must have no alpha channel when exported to *.raw format. Using GIMP’s text tool may introduce alpha. Your image must also have only one layer so make sure it is “flattened” or “merged” into one layer.

GIMP screenshot with finished Logo

If your image does have transparency you can remove it by right clicking on the layer in the layers list and selecting Remove Alpha Channel option from the menu. The menu is shown in the next screenshot.

GIMP screenshot showing how to remove alpha

When your image is ready to be saved, from the File menu choose Export As…. You must use File>Export As… and not File>Export so the Save File dialog appears (important).
If you want to make changes to your image in GIMP save it in GIMP’s native *.xcf format before you export. It’s probably a good idea to save it in GIMP’s format before you merge any layers.

GIMP screenshot showing File>Export As...

In the Export Image dialog, set your path and name your image with the .raw extension.
Expand the Select File Type options and select Raw image data before you press the Export button. You must do this or the image won’t be saved correctly.

Export Image dialog screenshot

In the dialog, set the raw image options to Standard (R,G,B). Our image is not an Indexed Palette Type so ignore those options and save the raw image by pressing the Export button.

Export Image as Raw Image dialog screenshot

Copy your *.raw image into the Logo folder in your TRLE installation folder. Check that is 384kB in size - the same size as the original uklogo.raw.

Logo folder open in Explorer screenshot

Open a command window and navigate to the Logo folder. In Windows 8.1, navigate to the Logo folder in explorer and in the explorer window select the File tab and choose Open a command prompt. I had to open an Administrator command prompt since my TRLE is installed in Program Files. At the command prompt type “packer” followed by your image’s filename including the .raw extension. For example,  packer uklogo5.raw. Press enter to create your *.pak file in the Logo folder with the same filename as the *.raw image.

Command prompt screenshot
Logo folder screenshot showing pak file

Copy your *pak to the Data folder in your TRLE folder and rename it if necessary to uklogo.pak. IMPORTANT: Move or rename the original uklogo.pak first.
Run tomb4.exe and test your image. If it looks nothing like your image in GIMP make sure there is no alpha channel and the format is RGB and there is only one layer.

OFF TOPIC: In Windows 8.1, tomb4.exe doesn’t seem to need the XP patch for quick loading.

In game title screenshot


Editing uklogo.raw


To open uklogo.raw in GIMP for editing, from the File menu choose Open…. In the Open Image dialog, select the uklogo.raw file and make sure you expand the Select File Type options and select Raw image data before continuing.

Open Image dialog screenshot

In the Load Image from Raw Data dialog, set Image Type to RGB and set the width to 512 and the height to 256. Leave the Offset at 0. You can ignore all the other options listed for Palette but make sure Palette File is None.

Load Image from Raw Data dialog screenshot

Once you have uklogo.raw open in GIMP, edit it as you wish then export it as explained above in the Creating uklogo.raw section.

GIMP screenshot with uklogo.raw opened


T4Larson’s Logo Packer

If you cannot run packer, try T4Larson’s Logo Packer found at trsearch.
Instead of running Logo Packer with the supplied *.bat file you can run it from a command prompt. Just make sure you navigate the command prompt to the folder that contains Logo Packer and your image file. Unlike packer, Logo Packer creates the *.pak file from file types other than *.raw. You can use *.bmp, *.jpg, *.tga or *.png.

See this post for details for editing the *.raw sky graphics.

No comments:

Post a Comment