How to make a terrain height map without photoshop?

So i’m following a tutorial for Unity which requires creating a height map using an image editor. As you know, Unity exports the terrain height map as a .raw file, and requires a .raw file to be imported as well. I’ve been trying for the past 90 minutes to get this to work. Here’s what I tried so far… (I am using Mac OSX)

  1. First, I tried importing it into Gimp. This did not work, because Gimp does not appear to support .raw files.

  2. I downloaded UFRaw plugin for Gimp. The plugin was a zip file which contained 75 files, mostly C scripts. According to the instructions for installing Gimp plugins (here: GIMP/Installing Plugins - Wikibooks, open books for an open world) I simply copy those files to the /Applications/GIMP.app/Contents/Resources/share/gimp/2.0/scripts/ directory. I did so and restarted Gimp, but it still did not accept terrain.raw.

  3. I downloaded RawTherapee and installed it. RawTherapee, for whatever reason, does not recognize the terrain.raw file. I’ve tried right clicking the file and using “open with” and selecting RawTherapee, and I’ve also tried navigating to the file within RawTherapee - in both cases, the file is not recognized.

  4. I tried converting the .raw file to a .jpeg via https://raw.pics.io/ but the website did not recognize terrain.raw.

  5. I downloaded and installed Fiji, which finally opened terrain.raw. I exported it as a .tiff file so that I could open it in Gimp and create a height map - finally some success! But then, of course, Gimp could not save it as a .raw, only .data. I tried exporting the .data and importing that into Unity, no success. I even tried re-naming it to a .raw (just to see if it was an arbitrary naming issue), but when I imported that into Unity it came out flat, without any height.

So I’m not usually one to go and ask questions online before I’ve tried a lot, but I feel like I’ve done my due diligence on this one. Can someone tell me how you can edit and import a height map into Unity without Photoshop? At this point I feel like I’ve tried every suggestion I’ve read on the web - using Gimp, using a Gimp plugin, using a raw-to-tiff converter, using an online converter, etc. Nothing seems to be working.

Any help would be greatly appreciated!

  • i have the same question, although GIMP 2.9.8 (2017-12-12) supports exporting to 16-bit raw format. it can now export as .data rgb planar, and import that file back into gimp as gray unsigned little- or big- endian.

  • supplementary: darktable purports to be a full-featured non-destructive raw image manipulation program, although the semantics of game engine vocabulary means this is the wrong kind of raw.

  • maybe some light on the matter:
    https://sozvyezdami.wordpress.com/2015/05/13/on-unity-5-game-engine-heightmaps-photoshop-imagemagick-linux-etc/
    [imagemagick has had gray 16-bit little/big endian capability for ten years, since 2008]

You don’t need to save it back out as RAW. You managed to import it into GIMP, so that’s what matters. What you want to export it back out as is a 16 or 32bit format that Unity can import, such a TIFF.

Here is a small tool I wrote to convert image files (e.g. png) to raw files compatible with Unity: