crude lithophane with OpenSCAD

small lithophane made from photographic portrait of Muhammad Ali in 1967. World Journal Tribune photo by Ira Rosenberg (source)

After reading I didn’t know lithophanes were so simple. They were hiding in Cura all along. : 3Dprinting, I thought I’d give OpenSCAD a shot at generating a lithophane image. It did not badly at all, considering this was my first try.

This isn’t a fast process and generates huge STL files, but it’s fairly simple. Here’s how I did it:

  1. Download your image. I used this 479 × 599 pixel preview.
  2. Convert your image to PNG, preferably grey scale
  3. Run it through the OpenSCAD script below, changing the parameters according to the instructions
  4. Render it in OpenSCAD (slow)
  5. 3D print the resultant STL in 0.05 mm layers (very slow)
//  somewhat rough OpenSCAD lithophane - scruss, 2019-10
 infile  = "479px-Muhammad_Ali_NYWTS.png";    // input image, PNG greyscale best
 x_px    = 479;  // input image width,  pixels
 y_px    = 599;  // input image height, pixels
 z_min   = 0.8;  // minimum output thickness, mm
 z_max   = 3;    // maximum output thickness, mm
 y_size  = 50;   // output image height, mm
 // don't need to modify anything below here
 translate([0, 0, z_max])scale([y_size / y_px, y_size / y_px, (z_max - z_min)/100])surface(file = infile, invert = true);
 cube([x_px * y_size / y_px, y_size, z_min]);

I used Makerbot warm white PLA. It looks decent at viewing distance, but close up it’s a bit stringy.

closeup of lithophane eye

There are better packages, but OpenSCAD does this better than I expected.

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *