Converting an Image to an STL 3D Model File

Date: May 08, 2024

A common task in 3D modelling is to be able to take a 2D bitmap image file, such as a PNG or JPEG file, and convert it to a 3D model. Obviously, image files are two-dimensional, so there are different methods of creating a 3D model from a 2D image file. Here we will look at the two possible ways an image can be converted to an STL file: Extrude and Heightmap.

Image Extrude to 3D

With the Extrude option, our Image to STL tools will examine your uploaded image file and attempt to trace an outline around the shapes that make up the image and, with this outline information, create a flat surface in 3D space with which to extrude by a set number of millimetres.

This mode works well with images that contain easily identifiable shapes that do not use many colours and is a great way to take logos, icons, and other image content and transform it into fully functional 3D models that you can then open in your favourite 3D modelling application for further editing.

Here is an example of a star shape that is converted using the Extrude method into a perfect 3D model:

A Simple Star Shape

A Simple Star Shape

The Extruded Star Shape as a 3D Model

The Extruded Star Shape as a 3D Model

Image Heightmaps

Creating a 3D STL model from an image Heightmap is quite different from the Extrude method. When converting using the Heightmap mode, all the individual pixels within the image are considered part of the final 3D model file, except for the background colour, which, using the default options our converter provided, is black.

A heightmap image consists of pixels of varying levels of grayscale, and the brightness of these grayscale pixels determines the height of the same pixel within the 3D model that is created. For example, assuming a pixel is black, the image to STL converter will place the corresponding 3D pixel at a height of 0mm. Now if that same pixel were white, then its height would be 10mm (assuming the default setting of 10mm for depth is selected).

Using this method, 3D models can be created to accurately represent 2D terrain stored in a common image format.

Here is an example of a star shape with a hole that is converted using the Heightmap method into a perfect 3D model. Notice how the grayscale corresponds to the height in the 3D model, with the darker, outer edges of the star lower than the inner sections and the dark, stepped centre hole creating a crater in the centre of the 3D model:

A Star Shape with a Hole in Grayscale

A Star Shape with a Hole in Grayscale

The Star Shape Processed as a Heightmap into a 3D Model

The Star Shape Processed as a Heightmap into a 3D Model

Supported Formats

Our image to 3D model tool supports a wide variety of formats, and although we have talked about using PNG and JPG files as the source input image files and STL as the target 3D model format, our converter supports many other image formats such as HEIC, TIFF, TGA, etc. The STL format is supported as the target 3D model format, along with other popular formats such as OBJ, BLEND, FBX, and many more.

To get started using the Extrude and Heightmap options, please use our Image to 3D Model converter tool.

© 2024 fabconvert.com