Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Gimp and Terrain RAW heightmaps

Discussion in 'Formats & External Tools' started by llde_chris, Oct 6, 2009.

  1. llde_chris

    llde_chris

    Joined:
    Aug 13, 2009
    Posts:
    205
    Hi,

    When you export a heightmap from the terrain, it appears as a RAW file.

    We know how to import the file via Photoshop, however not everyone here has photoshop, and some of the programmers like Gimp. How do we import the RAW file using Gimp? We can't seem to find the correct settings. :cry:
     
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I'm running Gimp 2.6.6 and it appears it should open and save a .raw file just fine. I don't have any files here to test it, but it should work. What problem are you having? Have you tried posting on the Gimp user's forum?

    Edit: Apparently Gimp uses the Ufraw plugin for this. It looks like the plugin comes with the standard Gimp package (at least it looks that way on my installation) so you shouldn't need to install anything. Here's the Ufraw website which might help:
    http://ufraw.sourceforge.net/
     
  3. pitibonom

    pitibonom

    Joined:
    Aug 17, 2010
    Posts:
    220
    nope. ufraw simply cant load unity terrain raw images :(
     
  4. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    You just resurrected a post over 2 years old.
     
  5. jake-gr

    jake-gr

    Joined:
    Oct 27, 2011
    Posts:
    93
    <rant> Why is resurrecting an old post so shunned upon?...
    Its over 2 years old... the situation is still valid (i too cant load terrains in gimp)...
    Also it shows that someone actually used the SEARCH feature before posting a new thread. So later if someone searches they wont be seeing 50+ posts on the same topic. </rant>

    is there by chance an alternative to ufraw that can be used to load terrain maps in gimp? (it works to load .raw from my camera, just unity terrain it wont open)
     
    ecv80, Xepherys, GBrundage and 6 others like this.
  6. KR1982

    KR1982

    Joined:
    Sep 30, 2013
    Posts:
    1
  7. Bering

    Bering

    Joined:
    Oct 16, 2013
    Posts:
    1
    Thanks, I had found this same link and tried changing the file extension to .raw but the key really is to click on the "Select File Type" option at the very bottom indeed.
     
  8. pietersmobile

    pietersmobile

    Joined:
    Jan 26, 2014
    Posts:
    11
    Nice! Thanx
     
  9. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    Hey, I'm the author of the post KR1982 linked above. I've since taken down my website, but since this post was getting some traffic, I've recreated it on my own site, here.

    Cheers!
     
    Last edited: Apr 10, 2019
    Lex4art, Lefko and CoughE like this.
  10. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Sorry to disappoint you, but Gimp is still unsuitable for heightmap work as it doesn't support high bit depth images.
     
  11. Petomai

    Petomai

    Joined:
    Jul 27, 2016
    Posts:
    2
    What is a person supposed to do then if they cannot afford photoshop?
     
  12. BerniceChua

    BerniceChua

    Joined:
    Nov 30, 2016
    Posts:
    32
    Hi everyone, if you cannot afford Photoshop like me, and use GIMP, I found this tutorial:


    Hope that helps!
     
  13. neighborlee

    neighborlee

    Joined:
    Jan 26, 2016
    Posts:
    50
    Nice one! I'll try that, as I'm in the #notphotoshop club ( income based decision)TY!
    I know its 2 yrs old almost, but with any luck its still relevant. The detail about using data then raw might have escaped me so ty for sharing.
     
    Last edited: Apr 3, 2019
  14. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    This thread is undead apparently, as it just got revived for the sixth time.
    I'll answer anyway, since it'll still show up when someone Google searches a solution for this problem.

    I have good news and bad news regarding the "but with any luck its still relevant" part.
    The bad news is that no, it's not relevant. (And it never was, since importing/exporting heightmaps in 8 bit is not a solution. It just destroys them.)
    The good news is that it doesn't matter anymore, because Gimp 2.10 was released in the decade since this question was first asked. And Gimp 2.10 supports high bit depth images.
     
    Xepherys likes this.
  15. neighborlee

    neighborlee

    Joined:
    Jan 26, 2016
    Posts:
    50
    Actually, it doesn't. I have GImp 2.10.8 and it refuses to open exported 16bit raw terrain from Unity, just now, as it still gives the error about needing raw pentex pef & one of the choices below. I checked import settings and its not working as I gimp import dialogue isn't working as advertised--I choose import raw data, and there is no 'raw' file to choose , just folders--odd ?

    I guess I should have made a new thread, didn't realize till now , that that video no longer appiles as I can't get it gimp to see it as raw image data, with file named terrain.raw from Unity.

    So is there no other option than to use dark table or raw therappee as such ? Seems a sad commentary if these lengths are needed for PS alternative ;)(
     
    Last edited: Apr 10, 2019
  16. Genero

    Genero

    Joined:
    Nov 14, 2012
    Posts:
    9
    I am currently experiencing the same issue. I have been exporting the heightmap from my terrain file, into a raw file, but it is not recognized by any software listed in these posts (not even dark table), yielding a different error in each program. The only way I have managed to get a response from the file, is by loading it into the rawpixels.net converter - but the output is still wrong; the flat parts of the terrain turn out completely white, while the hillsides along the edges turn into spiky pits. This makes me uncertain as to where the error is, and with the terrain system recently being reworked, it may be a bug in the export feature.
    Mind that this is just guesswork on my behalf, but I would love it if someone on the terrain team took a closer look at this problem. Exporting heightmaps to blender is just plain impossible at the moment.

    Edit: Since the goal of our project was to generate a low-poly terrain by loading the height-map into Blender, my team-mate has actually managed to find an alternative solution. There is a script which can export the terrain into an .obj-file and a tutorial to go with it, which can be found here:



    I hope this helps anyone who has been trying to tackle similar problems, but I would still like someone to look into the issue, as it would be much nicer if we do not have to rely on third-party plugins to get a hold of terrain data.
     
    Last edited: Apr 10, 2019
    QuangNhat and neighborlee like this.
  17. neighborlee

    neighborlee

    Joined:
    Jan 26, 2016
    Posts:
    50
    Gent and scholar- ty so much for taking the time to give a shout out that others are unfortunately affected by these issues, and great for sharing a video that while not the outcome we should have, ( obj's are not treated the same as terrain which would be very problematic for large terrains like mine) is a workaround to get things going ;)(

    TY ;)
     
    Last edited: Apr 10, 2019
  18. adamgffrd

    adamgffrd

    Joined:
    Sep 26, 2018
    Posts:
    35
    I too am having the same issue with exporting 16-bit raw greyscale heightmap file and failing to import into Unity. Sad times for Gimp users I supposed and I will not be purchasing PS, lol, that is not the answer.
     
    junctionboss likes this.
  19. Doodlefox

    Doodlefox

    Joined:
    Sep 29, 2019
    Posts:
    1
    Hey! Sorry, I know this has been revived a couple of times, but I just found a little bit of a workaround for this - it's not good though.
    GIMP can export as an 8-bit RAW, and Unity can read an 8-bit RAW, and then you can export from a Unity terrain as a 16-bit RAW. It's not good - I assume I'm losing a lot of the depth when I export from GIMP and I don't imagine Unity adds any when it exports, but for example I need 16-bit to import into MapMagic and this works. I hope this helps!
     
  20. junctionboss

    junctionboss

    Joined:
    May 11, 2014
    Posts:
    249
    Not sure this will help as sadly ,capitalism strikes again, me too, PS NEVER- Krita might get you there,Sorry if not but I can load .r16 files into krita from ue4,but Krita doesn't like raw,or I've yet to find right settings.

    Krita has a beautiful UI , prefer it to Gimp myself.
     
    Last edited: Nov 3, 2019
    Lex4art and prhcummins like this.
  21. Deleted User

    Deleted User

    Guest

    The fact that after 15 years of development, Unity only offers heightmap import from obscure proprietary Adobe-specific format, speaks volumes.

    For anyone interested, i believe (not an expert, just what came out of my testing) the problem with 16bit GIMP raws is the endianness. If you (instead of using grayscale) use RGB and paint blocks in gradient, one strip for each of 3 primary colors, from 0 to 255 saturation, you will see that one channel gives big changes in generated heightmaps, one channel give small changes, and 3rd one behaves indeterminably (noise).

    My guess that whatever (big/little - endian) encoding PS uses, GIMP uses the other.

    Also, the problem with GIMP is that in greyscale, even in theoretically 16 bit mode, 1 step on the color scale equals one step in all 3 chanell bits so while the image itself is 16 bit, in reality the palette is 8 bit. You can test by exporting some simple heightmap done in GIMP (it works) and enjoy the terraced terrain generated from it. No smoothness because i belive least significant 8 bits of color get lost.
     
  22. LadyK77

    LadyK77

    Joined:
    Aug 17, 2022
    Posts:
    3
    When I export from Gimp as a .raw file, it actually comes out as a .data file, and I think I'm experiencing a lot of problems from this. Any ideas?