World of Trainz - TRS2006 Thumbnails Tutorial World of Trainz - Home

Home > Tutorials > TRS2006 Creating and Adding Thumbnails to an Asset Tutorial

Creating And Adding Thumbnails To An Asset Tutorial

In this tutorial you will learn how to add thumbnails to an item before uploading to the DLS using various paint programs.

This tutorial assumes you already have a paint program installed such as Adobe Photoshop or Jasc Paint Shop Pro.

 

1. Opening for edit

The first thing we need to do is to find the asset that we want to create a thumbnail to and open it for edit. To do this use the search features of CMP to find the asset and then from the right click context menu select "Edit" and then "Open in explorer". This creates a copy of the asset from the database to the editing folder and opens the folder for viewing. Remember the location of this asset.

2. Creating and locating a screenshot in TRS2006

To create a screenshot in TRS2006 firstly load TRS2006 and then switch to driver. Navigate to a suitable screenshot location on your map. This may be a view from an interior, a loco or any applicable location and view. Once you have the desired area or item in focus then press the "Print Screen" button on the keyboard. You can take as many screenshots in one session as you like. Trainz automatically stores each screenshot so you don't have to worry about erasing the clip boards contents. Once you have taken the required screenshot exit TRS2006 and navigate to the folder you installed TRS2006 into. Once there open the "ScreenShots" folder and you will find your newly created screenshots. NOTE: This folder will not exist until you create a screenshot in TRS2006.

 

3. File types

The first thing you will notice about the screenshots is that they are all TGA files types. In a default install of Windows there is no viewer program available. If you have Photoshop, PSP, ACDSee or some other paint program or image viewer installed then you can double click on a TGA to view the image. If you do not have a viewer utility available then you will only be able to view the image in the editing program. Start your graphics program and load the image into the program. If you cannot remember which image is the correct one then you can open them all or a few at a time in your graphics program.

 

4a. Editing the TGA file in Photoshop

Once you have the desired screenshot open in Photoshop then the first thing we need to do is unlock the background layer. To do this select the background layer from the layers tab. Then double click on the small padlock to the right of the layer. A "New Layer" message window will appear. Leave the settings at the defaults and then click on OK. This will create a layer that is independent of the image size. The next step is to right click on the top of the images window. Then from the context menu select "Canvas Size..". In the window that appears type in a width of 240 and a height of 180 and then click on OK. You will then be presented with a warning about the canvas size. As we have unlocked the background layer we can click on OK without any problems. If we had left the background layer locked then the image would be clipped and that is not what we want.

 

Figure 1a Background layer

 

Figure 2a Padlock icon

 

Figure 3a New layer dialog

 

Figure 4a Context menu

 

Figure 5a Canvas size showing the new size.

 

Figure 6a Warning dialog

 

Now that we have the correct size image we need to resize and relocate the layer so that it can be seen correctly. From the "Edit" menu select "Transform" and then "Scale" Use the transform gizmo boxes to resize the layer until you have the desired result. You can also use the arrow cursor to move the layer around. Once you have resized the image using the boxes ensure the height and width scale settings are the same to avoid distortion of the image. The boxes are at the top left of the Photoshop window. Once you have the layer resized and positioned correctly then click on the tick icon (Commit Transform) at the top of the Photoshop window and the layers properties will change to suit the new dimensions. You will also notice that the image smoothens out.

 

Figure 7a Transform scale selection

 

Figure 8a Commit transform and cancel transform icons

 

Figure 9a Transform gizmo boxes

 

Figure 10a Transform scale width and height dimension boxes

 

Now that we have the image resized we can save the image as a jpg file. Select "Save as.." from the "File" menu and type an appropriate filename. In this instance I have used preview as the filename. While in the file "Save As" dialog change the save location to the location of the asset the image is intended for. Use the path you found in step 1. Once done click on OK and the JPEG options window will appear. Select the settings shown in figure 11 and click on OK. This gives a reasonably good image quality while keeping the file size to a minimum. You could also use even lower settings.

 

Figure 11a JPG Save options

 

 

Figure 12a Final result

 

4b. Editing the TGA file in Paint Shop Pro

Editing the tga file in Paint Shop Pro is possible but it is not as accurate and flexible as Photoshop. Firstly open the tga file in Paint Shop Pro and then place a selection window around the portion of the screenshot you wish to use. Try to keep the proportions of the selection box the same as the image size. Once you have selected the required area, select "Copy" from the "Edit" menu and then select "Paste" - "As new image" and a new image will be created based on the previously selected area. Now select "Resize" from the "Image" menu and change the settings to the same as figure 2b and click on OK. This will shrink the image down to the required 240 x 180 image size. Make sure the "Maintain Aspect Ratio" box is unchecked. Depending on how close your selection box was to the original image ratio will dictate how much distortion will occur. The closer it was to the original ratio the less distortion will be evident. If you want to use the entire screenshot without cropping any of the image then skip to "Resize" and type 15 (based on a 1600 x 1200 screenshot) into the "Percentage of original" boxes.

 

Figure 1b Selection area

 

Figure 2b Selection menu option

 

Figure 3b Resize... menu option

 

Figure 4b Resize settings

 

Once you have a satisfactory image then you can save the image to the assets folder. From the "File" menu select "Save As..." and then in the "Save As" window change the file type to "JPEG - JFIF Compliant (".jpg.".jif,".jpeg)"". Open the settings for the JPG by clicking on the "Options" button. A "Save Options" window will appear. Change the "Compression" to 15 and ensure the "Progressive Encoding" checkbox is selected. This will give a very small JPG.

 

Figure 5b JPG save options

 

Figure 6b Limitations warning

 

 

4d. Editing the TGA file in Irfanview

Editing the tga file in Irfanview is possible but it is not as accurate and flexible as the dedicated paint programs. Firstly open the tga file in Irfanview and then place a selection window around the portion of the screenshot you wish to use. Try to keep the proportions of the selection box the same as the image size. Once you have selected the required area, select "Crop Selection" from the "Edit" menu and the image will shrink to fit the selection window. Now select "Resize/Resample ..." from the "Image" menu and change the settings to the same as figure 2d and click on OK. This will shrink the cropped image down to the required 240 x 180 image size. Make sure the "Preserve Aspect Ratio" box is unchecked. Depending on how close your selection box was to the original image ratio will dictate how much distortion will occur. The closer it was to the original ratio the less distortion will be evident. If you want to use the entire screenshot without cropping any of the image then skip to the "Resize/Resample ..." and type 15 into the "Set new size as percentage of original" boxes.

 

Figure 1d Crop area

 

Figure 2d Crop Selection menu option

 

Figure 3d Resize/Resample menu option

 

Figure 4d Resize/Resample settings

 

Once you have a satisfactory image then you can save the image to the assets folder. From the "File" menu select "Save As..." and then in the "Save As" window change the file type to "JPG - JPEG files". A "JPEG/GIX save options" window will appear. Change the "Save Quality" to 10 and ensure the "Save as progressive JPG" checkbox is selected. This will give a very small JPG. I have found that the resulting image quality from Irfanview is not the best however for a simple preview image it is sufficient.

 

Figure 5d JPEG/GIF save options

 

4. CCP

Now that we have created the preview image we need to tell TRS2006 that the image exists. To do this there are two methods. The first is to open the asset in CCP and the second is to directly edit the config.txt file.

Return to CMP and right click on the asset again. Select "Edit" and then "Edit in Content Creator Plus". In the tree view select the entry with a yellow folder which is the kind of asset and right click, then select "Add a Thumbnails" entry from the context menu. This will add a thumbnails container to the asset. Once you have added the thumbnails container select the first entry in the container and then in the tag space you will notice three tags. To the right of the first one you will see two buttons. The "New" button should be avoided and not used. What it does is opens your default editor with a 128 x 128 tga file which is no use what so ever for this situation and I am not sure why Auran have set it up this way. Use the button next to the "New" button to open the "Load Image" dialog box and navigate to the image created in the previous steps. If everything works as intended then the "Load Image" dialog should already be in correct folder. In the "width" text box type in 240 and in the "height" text box type in 180, These settings are the dimensions of the image. Once complete save the config and exit CCP.

To do the same thing in a text editor you need the following entry;

thumbnails {
  0 {
    image "preview.jpg"
    width 240
    height 180
  }
}

 

Figure 13 Adding the thumbnails container

 

Figure 14 Container tree showing the new thumbnails container

 

Figure 15 Default tags and their settings

 

Figure 16 Correctly added thumbnail settings

 

5. CMP and committing changes

Now that we have the thumbnail added and configure correctly in CCP we need to return to CMP and commit the changes to see the results. Right click on the asset and select "Commit" from the "Edit" submenu. The new preview image should now show up in the preview window for the asset. The asset should now be able to be uploaded with out asking for the preview image.

 

Figure 17 New preview image

 

6. Brightness

Sometimes when you resize an image it will appear to become darker. If you experience this then there are one or two options to brighten the image. Most graphics programs allow the image brightness and contrast to be adjusted. Another option is to add a white layer over the top and then change the blend options for that layer. Other options may be available depending on the graphics program.

 
Was this tutorial helpful? Not enough or too much detail? Points not explained properly? Suggest any improvements? Please use the Tutorial Enquiry Form
 
 
 

 

Trainz and Trainz Railroad Simulator are trademarks of Auran

Best viewed at 1024 x 768 or higher

Pages best viewed with Cooper and Cooper Black font installed.

Copyright © 2007 P. Campbell. All rights reserved. Revised: June 13, 2007