I'm importing grayscale elevation images (bmp and jpeg) into a program I use for 3d CNC terrain carving. I've been downloading Hi-Res terrain corrected DEM files from ALOS PALSAR. I bring them into ER Viewer and export them as bmp files.

When I extrude the bmp the terrain is stepped, which onscreen grayscale looks smooth and does not indicate.

What am I doing wrong here. It must be something I don't understand about raster files and the way they behave. I just want to have raster files that are smooth and not stepping. I'm calling it stepping as its not exactly like contour lines but it will be noticable when I come to carve these.

2 Answers 2


This is likely a difference in bit depth. Whatever format the DEMs are provided in probably stores each pixel as a 32 or 64 bit float. These can store values out to a handful of decimal places and therefore represent a height change between neighboring pixels in a fraction of a unit. The GDAL docs suggest that the BMP format can only store 8 bits per color channel. This would limit the pixel values to whole numbers from 0-255, basically cutting off the decimal precision entirely. The difference between neighboring pixels can no longer be less than one unit (a meter?), and so you get that stair-step effect.

Check what other formats your CNC software can handle. TIFF is a common one that can handle higher-precision data types.

  • 1
    Thats very helpful. Tried tif and jpeg and both much better
    – carl
    Nov 9, 2018 at 9:33

The DEMs included with the ALOS PALSAR RTC products available from ASF are NOT generated from ALOS PALSAR imagery. They are the DEMs that were used for RTC processing, which were simply mosaicked and clipped from publicly-available DEMs, such as SRTM and NED. They have been resampled to match the pixel spacing of the RTC product (12.5 m for the high-res product), but that is NOT an indication of the original DEM resolution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.