Creating a raw file

From Rigs of Rods Wiki

Jump to:navigation, search

So you've worked hard your wonderful terrain, but now how are you going to get it in game? First you'll need to turn it into a .raw file!

Contents

Installing Imagemagick

To convert your terrain from a .png/.jpg (FYI Don't use .jpg)/.bmp into a .raw file you'll need to install imagemagick. You can download the latest version for your OS here:

Windows

http://www.imagemagick.org/script/binary-releases.php#windows

Unix/Linux

http://www.imagemagick.org/script/binary-releases.php#unix

Once you've installed imagemagick you can proceed to the next step

Converting the image

Now that you've got imagemagick installed you can convert the image. All you have to do is follow these steps:

  1. Open the folder with your .png/.bmp file in
  2. Hold the shift key and right click (Make sure no files are selected though!)
  3. Click on "Open Command Window Here"
  4. In the Console that has just opened, type:
convert filename -resize 1025x1025 -endian LSB -flip gray:raw filename.raw

You'll need to change the parts in bold, here's what they mean:

  1. filename: This is the filename of your terrain .jpg/.png/.bmp image
  2. 1025x1025: You don't need to change this unless you know what you're doing
  3. raw filename: this is the filename of the .raw you want to generate.

Creating a .png from a .raw

But what if you need to convert something that's already a .raw to something you can edit? then you need to follow the same steps as above, but enter this into the console instead:

convert -size 1025x1025 -endian LSB -flip gray:raw filename  filename.png

And there you have it, a .png file created from the .raw for you to edit.


Automated Image to raw file Bat scripts

Here are two bat scripts to quickly convert files to and from .raw, they both require imagemagick to be installed.

Saving

To save them just use notepad to save them to "ToRaw.bat" and "RawToPng.bat" (Make sure "All Files" is selected!)

Usage

To use them just drag the image you need to convert onto the saved bat file.

To Raw.bat Will create a 1025x1025 .raw file

@echo off
echo Converting %1 to .raw
convert %1 -resize 1025x1025 -endian LSB -flip gray:%1.raw
echo done
pause

Raw To Png.bat Will turn a 1025x1025 .raw file into a 1025x1025 .png image

@echo off
echo Converting %1 to .png
convert -size 1025x1025 -endian LSB -flip gray:%1 %1.png
echo done
pause

If the raw is a different size (I.e. not 1025x1025 you can change the bolded values to the correct ones)