Author Topic: 8bit BMP grayscale to raw.  (Read 4252 times)

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: 8bit BMP grayscale to raw.
« Reply #15 on: April 04, 2017, 12:43:16 PM »
So it is as I remembered Greebo which is why I used it to block out land and not really to do elevations since 32,767 land height variations is a bit much to do by hand. Especially since I was not sure what RGB value evaluated to what height for the full range.

For example 255,0,0 equals what? Or 253,12,1 equals what?

This is why when I did it intially I used to block out the shorelines and then did just rough elevation work of creating mountain ranges. But even then sometimes I ended up missing something and you would have a mountain spike happen looking like the tower of the eye of Mordor in the terrain. Couple people ran across these odd spikes over in blksea and blkseaw.



X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #16 on: April 04, 2017, 01:19:09 PM »
This sounds like I can accomplish my assumption. You can rapidly make shore lines with a 6mile dia. brush and the smoothing tool. The raise\lower mound tool I can cut and shape a world in my sleep after my first terrain. I needed exactly a way to quickly prototype my raw land like when you glue together blocks of wood, then put them in a lathe to create a bowl. This will eliminate a large amount of time spent using the CBM map as a cutting template. I bet I can use the height.raw from my terrain and a color picker tool to create my gross elevation building blocks since I know the terrain elevations after spending so much time with it.

I cannot believe Krita is a free art and animation program that also does height maps. It has some gradient tools that look like I can set two colors on a shape then have it fill the shape in that gradient if I set a center point and it will effectively create a topographical layering of the gradient between the two colors.

Now I have to learn another art program just to see if I can create topographical gray scale gradients. If the program has 8 and 16 bit heightmap formats, then the gradient tools will probably accomplish topographical gradients. I'm not attempting to recreate any place in the real world so my free hand skills will work for the rest once I import it back into the TE.   
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #17 on: April 04, 2017, 04:58:01 PM »
I just installed ImagJ to look at the height.raw heightmap file from my bowlma project. It can import and export in 8 and 16 bit raw format. I had to set the import to Little-endian byte order so white was the 28,000ft elevations and funny, black is showing negative depths under the water. Now I see if I can create a 16bit grayscale png file and export it to 16bit raw for the terrain editor. I suspect the TE will see "black" as sea level, I hope.

I started reading other game's terrain creation forums, and creating a grayscale heightmap file, then converting to raw is pretty standard. Some only use a png format grayscale heightmap. But then, their land area is much smaller than the AH MA. It's getting interesting digging into this, and hopefully the 16bit raw file export from ImagJ will be compatible with the TE when I generate my test file. I can always do the export from Krita as an .r16 and change the extension as Greebo described. 
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #18 on: April 05, 2017, 12:47:22 PM »
Buzzsaw might have been created with black and white as colors and a spiral gradient tool. Converted to 16bit raw and imported into the TE as a heigth.raw if you were in a hurry, and knew you could manually touch up after that inside the TE.

I've been experimenting with a color tool called a gradient contour filler. Now if my island edges are at zero elevation or black, and I sample my heightmap for gray color at places I know are certain elevations from looking in the TE. I can set my two colors to run the gradient contour fill. Then do manual touch up or modifications inside the TE after I import the raw contour elevations. I just have to use layers so I can eventually change the water level to black after I manipulate the land masses. This is all speculation until I can import my 4096x4096 black and white file into ImageJ and export as a 16bit raw file.

Here is an island I'm playing with to learn the tool I found. Who knows what will happen, but, so far it's better than nothing and I don't feel like buying a third party terrain program when I'm only making fantasy islands.


bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #19 on: April 05, 2017, 01:02:30 PM »
This is getting good, better gradient contour lines, looks like when I super zoom in on the "height.raw" from my terrain bowlma. Now I really hope I can create a 4096x4096 heightmap and get it converted to raw and back into the TE.


bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: 8bit BMP grayscale to raw.
« Reply #20 on: April 05, 2017, 03:15:51 PM »
Nice stuff so far.  :aok
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #21 on: April 05, 2017, 05:05:00 PM »
Hitech,

Thank you for verifying what ghostdancer posted for me. He said the files are 16bit.

I hope you know I have absolutely no clue what I'm doing here, I'm just guessing, then pushing buttons in art programs to see if anything blows up. And reading other game forums discussions about heightmap files for their terrains. Other game's players seem to talk more about them than we do here for creating the raw land masses in their terrains. Still, our arenas are ginormous but, if this works, I can see how I could have eliminated many hours of mind numbing work by creating the raw land masses in an art program as a 2D map first.

Well back to pushing buttons and seeing what breaks....... :O
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #22 on: April 05, 2017, 09:08:07 PM »
I have avoided learning GIMP, now so I can create 16bit PNG grayscale files and have a gradient fill option, I'm downloading GIMP.

I will still have to convert it through Krita into 16bit raw unsigned. Seems Paint.Net is an RBG only application but, it does do a great two color gradient contour fill on shapes. There is always a catch to this. I know "now" I could make a CBM of an empty 20x20 arena and paint my land areas onto that as line drawings. Then drag the terrain tool a click at a time re-positioning the CBM every few strokes. I would rather do it once on a 4096x4096 grayscale PNG file in an art program.

 
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12339
      • http://www.hitechcreations.com
Re: 8bit BMP grayscale to raw.
« Reply #23 on: April 06, 2017, 10:01:13 AM »
Also take a look at l3dt for creating the base height maps. It works well with our height map exports.

http://www.bundysoft.com/L3DT/downloads/

HiTech

Offline jimson

  • AvA Staff Member
  • Platinum Member
  • ******
  • Posts: 7202
      • The Axis vs Allies Arena
Re: 8bit BMP grayscale to raw.
« Reply #24 on: April 06, 2017, 11:40:23 AM »
Trying to wrap my mind around this stuff, but I need to create a small strip of land, smaller than the TE brush allows, an island so to speak, with a uniform height of about 100 feet. Is this possible using one of these techniques?

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: 8bit BMP grayscale to raw.
« Reply #25 on: April 06, 2017, 12:15:32 PM »
Well the smallest bit of land you can make with this method is 1 pixel. In a map you have 4096 x 4096 pixels which equates to 512 x 512 miles. Convert you those to feet and you get 2,703,360 feet by 2,703,360 feet.

So if my numbers are right basically ever pixel on the height map represents 660 ft. So that is the smallest bit of land you can make via the heightmap.raw file.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #26 on: April 06, 2017, 12:41:54 PM »
Trying to wrap my mind around this stuff, but I need to create a small strip of land, smaller than the TE brush allows, an island so to speak, with a uniform height of about 100 feet. Is this possible using one of these techniques?

I succeeded in using the black and white screen capture jpeg contoured island and generating a terrain by importing a heightmap. Hitech has suggested I look at L3DT. The screen shot below shows what happened when I copy and pasted the island picture above directly into the grayscal PNG file I then converted to RAW and imported into the TE.

The top of the island which I created on a 512x512 project sheet in the screen capture is 25,000ft high, so it appears I needed to set my contoured gradient fill to gradient at the single pixel level, or the closest possible. In the end you wouldn't have a smooth land mass but, one generated with micro steps defining the topography. That was going to be my next testing hurdle with my gradient tool. I need to get a reply from Hitech on what hight ratio to use in L3DT for a 4096x4096 project.

Yes Pinky(bustr), that is the corner of a 25,000ft wall and 25,000ft 6 mile diameter cylinder.


bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12339
      • http://www.hitechcreations.com
Re: 8bit BMP grayscale to raw.
« Reply #27 on: April 06, 2017, 01:42:31 PM »
Trying to wrap my mind around this stuff, but I need to create a small strip of land, smaller than the TE brush allows, an island so to speak, with a uniform height of about 100 feet. Is this possible using one of these techniques?

Set brush to alt, click beginning and end of your land strip. This makes 2 islands.

Now use the plow tool to make the strip between the two ilands.

HiTech

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #28 on: April 06, 2017, 01:43:50 PM »
So I just tested reducing the height of the land mass. I created a gradient contour fill jpeg, pasted it into the PNG grayscale heightmap file and converted to raw format. I kept the gradient closer to black and still ended up with the center of the island at 8000ft. And the smaller the land mass, the more noise around the edge's as you can see. But the topographic shape is much smoother. You can see how the center 25k 6 mile diameter cylinder was displaced when I imported the heightmap file.

It appears you cannot import a heightmap to create one tiny thing, you have to build the complete terrain as the heightmap and just happen to have your very tiny strip of land in it. Before I added the island in the center, there was a center cylinder, the square wall, four posts and the giant island. I pasted the new island into the source PNG file, then converted that to RAW. When I ran the import, all of the terrain features were recreated along with a new center of the terrain.

I'm beginning to see the advantages to L3DT. Though, I suspect I can still create a 20x20 terrain once I work out the altitude scaling.








bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 8bit BMP grayscale to raw.
« Reply #29 on: April 06, 2017, 04:56:51 PM »
L3DT hasn't sent me my temp license so I can test the Pro version for 90 days.

Leave me alone with nothing to do...heheheheh.

I decided to run a Gaussian blur tool on the PNG file and I got the center island down to 3k at it's highest elevation and the wall\cylinders\big island down to 12k and nicely smoothed. Granted L3DT throws in some runoff texturing and rock structure. Still, this is not bad for a hand worked terrain when you first start out.





bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.