Introduction: How to Convert a 2D Image / Photo Into a 3D Printed Image!

As we recently wanted to make some 3D printed photographs, we created proessing code, which allows us to create 3D maps from images.

What do we need?


Processing 2.x.x

Blender (or similar)

The Processing code:

https://github.com/Jana-Marie/Image-to-3D-map

Step 1: ​ What Do We Want to Do? What Does the Code Do?


So basically what the code does is, it slices a picture you give it, in colums and rows. The default resolution is 16*16, that means, that the code creates a cell out of 16*16 pixel. With the "+" and the "-" key you can change the resolution from 1*1 to "infinity*infinity". By changing the resolution, the refresh rate of the map will go down and the files you can create will get bigger. You can change the strenght of the effect by moving the mouse. By default it is fixed on the dark tones but by pressing "i" you can focus on the lighter tones ( for 3D printing focus on the darker one :) ). Now the code will depending on your inputs and the values of the cells create now a specific height ( z ) per cell. The pixels will replaced with boxes in cellsize with the specific height ( z ). It also color them but they wont be exported into the 3D modell, I may add that later. You will see the result "live" on your screen, as already menioned the refresh rate will go down by getting the resolution hight...

After you choosed the settings you want, you can press "s" or "S" to save/export an .obj and a .jpg file to your sketch file.

By pressing "h" you will get some help.

Always have a look at the console, it shows help and resolution informations.

The code uses the library: nervoussystem.obj

The code: https://github.com/Jana-Marie/Image-to-3D-map/tr...

Step 2: What Do We Want to Do? What Does the Code Do?

So basically what the code does is, it slices a picture you give it, in colums and rows. The default resolution is 16*16, that means, that the code creates a cell out of 16*16 pixel. With the "+" and the "-" key you can change the resolution from 1*1 to "infinity*infinity". By changing the resolution, the refresh rate of the map will go down and the files you can create will get bigger. You can change the strenght of the effect by moving the mouse. By default it is fixed on the dark tones but by pressing "i" you can focus on the lighter tones ( for 3D printing focus on the darker one :) ). Now the code will depending on your inputs and the values of the cells create now a specific height ( z ) per cell. The pixels will replaced with boxes in cellsize with the specific height ( z ). It also color them but they wont be exported into the 3D modell, I may add that later. You will see the result "live" on your screen, as already menioned the refresh rate will go down by getting the resolution hight...

After you choosed the settings you want, you can press "s" or "S" to save/export an .obj and a .jpg file to your sketch file.

By pressing "h" you will get some help.

Always have a look at the console, it shows help and resolution informations.

The code uses the library:

nervoussystem.obj

The code:

https://github.com/Jana-Marie/Image-to-3D-map/tre...

Step 3: How to Use It?

Controls:

press:

+ or - to change resolution

i to invert the effect

s or S to save a .obj and a .jpg

h to get help

move your mouse to change the strenght of the effect

Input file:

In the sketchfolder there has to be a .jpg file named "input.jpg". It should be smaller then your screen size, otherweise the files will get to big and the window opening will be bigger then your screen ;)

Just play alot around with it, a unbroken version of it will be there for you on github ;)

Step 4: Prepare Saved .obj for 3D Printing

After you´ve saved a .obj file, you have to prepare it for 3D printing. I use blender for it.

Open Blender and remove the standart file ( the block, camera and lamp )

Step 1: Use file>>import>>wavefront(.obj) to import a .obj

Step 2: Use your middle mouse button to move your view to the up right corner, there will be your .obj

Step 3: Press the small + next to the "Scene" window in the upper right corner

Step 4: Make sure, that your .obj is selected. Set the locations and Rotations to 0

Step 5: Set scales to 0.2, 0.1 or 0.05 (0.1 is very good)

Step 6: Now we have to set the Z axis to 0 because the print is normally -100 be´s down. You have to scale this your head, if you used 0.1 for scale, set Z to 10 ( for 0.2 set 20 and for 0.05 set 5 )

Step 7: Go to file>>export>>.stl

Step 8: epic win! Now you have your printable picture in the common .stl format!

Notice:

There is 2 layer hight plate under the print, it is for support and will let go the printer faster...

It is gone with full resolution, if there is some plate left, cut it after printing....

Step 5: Printing Notes

Important, set your printing infill density to 100% otherwise it wont work and use half transparent filament. I used a green one.

Step 6: Result(´s)

So we got first results \o/

Sadly the printer didn't want to make a fine print that evening, the pla broke while printing, but we got a acceptable result! you can see the cat! After that we changed the code a little bit, now it weill create some very fine maps for 3D printing.

Now I need you, if you´ve tried it, please post a picture in the comments of your print or 3D map!

I would be really glad to see some results :)

Step 7: Run Code Without Processing

Don't want to run processing every time?

Processing has an option to create a standalone application from the code, just click file>>export application or press STRG/CTRL + E. This will create depending on the OS a folder with a starting file (.bat on windows), with embedded java. So you can run the code without needing anything else..

That is very awesome and useful!

Step 8: Thank You for Reading!

Thank you for reading, I hope, that it was helpful for you!

It would be glad if you vote for me... :)

The Cat says also Thank you!

=^-^=

Tech Contest

Participated in the
Tech Contest

Teach It! Contest Sponsored by Dremel

Participated in the
Teach It! Contest Sponsored by Dremel

Formlabs Contest

Participated in the
Formlabs Contest