Image to STL: turn a PNG or JPG into a printable relief or outline
By Sina Esfahani, OmniTechs · Published 30 November 2026
A PNG or JPG has no depth, so every image-to-STL tool has to invent one. There are two ways to do that. A height-map relief turns the brightness of each pixel into a height; it suits photos, shaded drawings and textures. An extruded outline traces the shape and lifts it to one height; it suits logos, silhouettes and text. Free tools do both: UltiMaker Cura opens a PNG or JPG directly as a relief, and online converters such as ImageToStl offer both modes.
Start by looking at your image. Two colours with sharp edges: take the outline route. Shades of grey that matter: take the relief route. Then decide the final width in millimetres before you open any converter. That one number sets how many pixels you need, how fine the detail can be and how big the file becomes.
Convert it in this order:
Choose the route: outline for two-tone images, relief for shades of grey.
Fix the print width in mm and resize the image to about 2.5 to 5 pixels per mm (250 to 500 pixels for 100 mm).
Crop, convert to greyscale, raise the contrast, remove transparency and save as PNG.
Set base and relief height, for example 1.6 mm and 2.4 mm: 12 height steps at 0.2 mm layers.
Smooth lightly, enough to remove JPG noise but not the edges.
Convert, open the STL in your slicer and check size, errors and the layer preview.
Print a 30 × 30 mm test crop before the whole picture.
Relief or outline: which route fits your image
Choosing the route by the image you have
| Your image | Route | Why |
|---|---|---|
| Photo, portrait, pet, landscape | Height-map relief | The shades of grey carry the picture and become heights |
| Drawing with shading or texture | Height-map relief | Same reason; keep the contrast high |
| Logo, silhouette or text, dark on light | Extruded outline | Two tones with sharp edges; one height gives crisp walls |
| Logo you also have as an SVG | Outline from the SVG | The vector file already holds clean contours |
| Photo to be lit from behind | Lithophane | Thickness controls light, not shadow |
| Object you want in the round | Neither | One image does not show the hidden sides |
Whether a photo should become a relief, a lithophane or a full model, and what to check about the rights to it, is decided in 3D printing a photo: relief, lithophane or model. AI tools that promise a full 3D model from one picture belong to the last row: they have to guess the sides you cannot see. This page covers the two flat routes.
Pixels and millimetres: how much resolution you need
Pixels per mm = image width in pixels ÷ print width in mm. One pixel on the print is the inverse: print width ÷ pixels.
A printer cannot draw detail much finer than the line it extrudes, and for image prints UltiMaker advises keeping the line width close to the nozzle size. As an editorial rule of thumb, a pixel of 0.2 to 0.4 mm on the print (2.5 to 5 pixels per mm) carries all the detail a 0.4 mm nozzle can show. More pixels add triangles, not detail. How nozzle, line width and layer height relate is explained in nozzle size, layer height and line width.
The triangle count matters because a converter that places one point per pixel, as Cura does, builds the surface from two triangles per square of four neighbouring pixels: 2 × (width − 1) × (height − 1) triangles. A binary STL stores 50 bytes per triangle after an 84-byte header.
What the image size does to a relief file
| Image in pixels | One pixel on a 100 mm print | Triangles on the top surface | Binary STL size |
|---|---|---|---|
| 400 × 300 | 0.25 mm | 238,602 | about 12 MB |
| 512 × 384 | 0.20 mm | 391,426 | about 20 MB |
| 1,600 × 1,200 | 0.06 mm | 3,834,402 | about 192 MB |
| 4,000 × 3,000 (12-megapixel phone photo) | 0.025 mm | 23,986,002 | about 1.2 GB |
Cura limits this for you. Its image reader scales any picture whose longer side exceeds 512 pixels down to 512 (UltiMaker's source code). At Cura's default width of 120 mm that is about 0.23 mm per pixel; at 200 mm it is 0.39 mm, the edge of what a 0.4 mm nozzle shows. For larger prints use a converter that keeps more pixels, and if the slicer then struggles, see STL file too large.
For the outline route the sum is about the thinnest part. Measure the narrowest line or gap in pixels and divide by pixels per mm. A 3-pixel line in an 800-pixel logo printed 80 mm wide (10 pixels per mm) becomes 0.3 mm: thinner than one 0.4 mm line. Thicken it in the image before you trace.
Depth: base, relief height and what the layers can show
A relief has two heights: the base, a solid slab under everything, and the relief on top. In Cura, Height (mm) is the maximum distance of each pixel from the Base, so the thickest point is Base + Height.
With a linear mapping, height = base + (grey value ÷ 255) × relief height. An 8-bit image runs from 0 (black) to 255 (white). Which end is high is your choice: Cura offers "Darker is higher" and "Lighter is higher"; in ImageToStl's Heightmap mode a black pixel is 0 mm and drops out of the model unless you add a base, while a white pixel gets the height you set, and Invert Output swaps them. Try both directions on a small crop.
The printer turns those 256 grey levels into whole layers. A 2.4 mm relief is 12 steps at 0.2 mm layers and 20 steps at 0.12 mm, so about 13 to 21 neighbouring grey levels land on the same layer. Greys of 200 and 210 differ by 0.09 mm at 2.4 mm of relief: less than one layer, so they merge. Strong contrast survives; subtle tones do not. How many layers a relief needs to read well is worked out in 3D print a terrain map: how much relief stays visible; its starting point is at least 10 layers over the main relief. Thinner layers buy more steps at the cost of print time, as described in choosing a layer height.
Editorial starting values for a wall plaque in PLA on a 0.4 mm nozzle: base 1.6 mm (8 layers of 0.2 mm) and relief 2 to 3 mm. Cura's defaults, Base 0.4 mm and Height 2.5 mm, are set up for lithophanes, which UltiMaker builds on one or two base layers; a plaque needs a thicker base.
Smoothing and noise
Every speck in the image becomes a bump. JPG compresses in blocks of 8 × 8 pixels and discards information (lossy); PNG keeps every pixel (lossless). Block edges and camera noise turn into fine ridges at print scale. So save the edited image as PNG, and smooth a little:
Cura, Smoothing (0 to 100, default 1): each step averages every pixel with its eight neighbours. UltiMaker notes that higher values smooth edges but reduce contrast and accuracy. Start at 1 to 3.
ImageToStl, Enable Smoothing: smooths spikes caused by contrasting neighbouring pixels.
Any image editor: a blur of 1 to 2 pixels does the same before conversion, and you can see the result.
Resizing to your target pixel count is itself the strongest noise filter: it averages away detail the printer could not show anyway.
Transparency needs one fix before Cura. Cura multiplies every height, including the base, by the pixel's opacity, so a fully transparent background becomes zero thickness. Flatten the image onto a white or black background first.
Free tools and their steps
UltiMaker Cura (desktop)
Cura opens JPG, JPEG, PNG, BMP and GIF files as models.
Choose File > Open File(s) and select the image. The Convert Image dialog opens.
Set Height (mm) for the relief and Base (mm) for the slab.
Set Width (mm) or Depth (mm); the other follows the image's proportions.
Choose "Lighter is higher" or "Darker is higher".
Set Color Model to Linear. The default, Translucency, is a logarithmic model for lithophanes; Linear makes heights follow the grey values directly.
Set Smoothing and click OK.
Slice in Cura, or save an STL for another slicer with File > Export... and the file type "STL File (Binary)".
Cura's Convert Image settings for a relief plaque
| Setting | Cura default | Starting value for a plaque |
|---|---|---|
| Height (mm) | 2.5 | 2 to 3 |
| Base (mm) | 0.4 | 1.6 |
| Width (mm) | 120 on the longer side | your planned width |
| Darker or Lighter is higher | Darker is higher | test both |
| Color Model | Translucency | Linear |
| Smoothing | 1 | 1 to 3 |
ImageToStl (online)
ImageToStl converts PNG and JPG online: you upload the image and the conversion runs on ImageToStl's servers. Heightmap mode turns brightness into height; Extrude mode traces the edges and extrudes the shapes. Set Width, Height and Depth, use Add Base for a solid slab, and Enable Smoothing for spikes. For an outline, tick Same Height Extrusion so every part gets one height instead of a height by brightness. The Detail setting (default Medium) trades resolution for file size. Large images are resized: the page gives both 1,000 × 1,000 and 1,200 × 1,200 pixels as the limit. ImageToStl says it does not store the image you submit and keeps the STL for 4 hours, with a Delete button. Even so, think before uploading a photo of someone else.
Outline route: trace, then extrude in your slicer
Clean the image: a pure dark shape on a pure white background, thin parts thickened.
In Inkscape (free): File > Import, select the image, then Path > Trace Bitmap (Shift+Alt+B). Choose Brightness cutoff, click Update to preview, then Apply. Inkscape's manual calls this mode ideal for dark silhouettes on a bright background.
Delete the bitmap, keep the traced path and save it as SVG.
Import the SVG. Bambu Studio loads SVG files as a model object (since version 1.4). In PrusaSlicer, right-click an object, choose Add part > SVG and set Depth.
Check closed contours, small gaps and the final size first, as in SVG to a 3D-printable logo. Bambu Lab's release note and Prusa's help page, read on 30 November 2026, describe SVG import; neither describes a PNG or JPG height-map import. For a relief, convert in Cura or online and open the STL in your own slicer.
Check the STL before you print
Size. STL stores triangles but no unit. Measure width, depth and total height in your slicer against your plan.
Errors. Look for repair warnings in the slicer. A Cura height map is built with walls and a bottom, so it should be closed; transparent pixels and broken downloads are typical causes of holes. The full check is in open and check an STL file, and how to judge a repaired file is in check an STL repair.
Layer preview. Slice and scroll through the layers. The lowest areas must still sit on a solid base. Count the layers your main features get.
Slicing time and file size. If the slicer struggles, go back to the image and reduce the pixels rather than simplifying the mesh blindly.
Test crop. Crop a 30 × 30 mm piece of the most important area, such as a face or the thinnest line, and print it with the same settings.
You are done when the test crop shows the detail you care about and the full STL measures what you planned. Change the plan instead of the settings when the key detail is thinner than one line width, when it differs by less than one layer in height, or when the picture only makes sense in the round.
Worked example: a 100 mm photo plaque
A hypothetical 1,600 × 1,200 pixel photo of a dog, printed as a 100 × 75 mm wall plaque with a 0.4 mm nozzle and 0.2 mm layers.
Pixels. 1,600 ÷ 100 = 16 pixels per mm, 0.06 mm per pixel. Far finer than a 0.4 mm line; one point per pixel would be 3.8 million triangles and about 192 MB.
Resize. At 400 × 300 pixels: 4 pixels per mm, 0.25 mm per pixel, 238,602 triangles, about 12 MB. Cura would scale the original to 512 × 384 by itself: about 20 MB.
Prepare. Crop to 4:3, convert to greyscale, raise the contrast, flatten transparency, save as PNG.
Cura. Width 100 mm (Depth follows at 75 mm), Base 1.6 mm, Height 2.4 mm, Color Model Linear, Lighter is higher, Smoothing 2.
Expect. Total thickness 4.0 mm and 12 relief steps. A mid-grey of 128 sits at 1.6 + 128 ÷ 255 × 2.4 = 2.80 mm.
Check. The slicer shows 100 × 75 × 4.0 mm and no errors. Print a 30 × 30 mm crop of the eyes first.
The contrast: the same dog as a black silhouette takes the outline route. Its height comes from the extrusion depth, not from grey values, so the sum that matters is the thinnest part. At 10 pixels per mm, ears or whiskers narrower than 4 pixels end up below one 0.4 mm line.
Next step
When your STL measures right, the OmniTechs 3D printing cost page accepts STL, 3MF, OBJ and PLY files up to 256 MB and shows material, print time and a price estimate for a print in PLA or PETG, made in Groningen on FDM printers. The 12 MB file in the example fits easily; a full-resolution phone photo at 1.2 GB does not.

