2D Image to STL Converter (Windows)

by BloodBlight, published

2D Image to STL Converter (Windows) by BloodBlight Mar 26, 2013



Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

91595Views 25415Downloads Found in Art Tools


UPDATE - 2013/06/16

If you have an Ultimaker, upgrade to Cura 13.06 or newer!
NOTE: It is a closed beta right now, so you will have to hunt for the link. I will not be posting it because of it's status.

UPDATE - 2013/06/15

Alpha 1.8.1:

  • Resized form to fit smaller screens; the next major release will have a resizable form.
  • BUG: STLs are being created with a zero height base in some cases. This is NOT fixed in this revision.

UPDATE - 2013/04/14

Alpha 1.8:

  • Windows XP Support
  • Added Resolution Limiter
  • UI Improvements
  • New Anti-Spike Features

Let me start by saying this is an Alpha! There are features missing and known bugs (specifically in surface duplication).

I saw a stamp maker the other day but it was Mac only (OmNomNom - http://www.thingiverse.com/thing:24639), and the author didn’t want to translate it, so, I made one over the weekend!

I plan to add RGB control, a blur function, additional surface optimizations and an option to smooth high boarders (very useful in B/W [stamp] mode).

Tell me what you think! Is there something out there that is better than what I have scrapped together?

Have fun!


I have attached a ZIP of Alpha 1.5. The source is available under GPL3 from its GIT hub:

It requires Windows and .NET.

More from Art Tools

view more

All Apps

Upgrade this Thing with Thingiverse Apps

No results.

Hi, Ive studied your program extensively and the other apps too...

Conclusion is that i could use it for fun stuff very nicely, but it's not useful for serious mesh creation.

It would be relatively easy to make it professional quality output: just forget all the weird mesh optimization that exists in the program, making different sized cubes, was a fun puzzle to program but it's full of errors. Only two things are necessary to fix it: 1/output unoptimized triangulated mesh with one triangle per sample... a 200 meg file of proper triangles loads in Meshlab faster than a 10mb mesh with errors as in the HGT 2STL :) ... ... condition 2/ second condition is that the triangles must be welded or perfectly minimized vertices, because you can take a 200meg file of tiny triangles and optimize it in meshlab in 2 minutes using laplacian smooth, which divides the polys in 10, much better than the original attempt...

So... for a future dude that asks you advice to code the same thing: 1/make perfect triangular small mesh that can import into meshlab... put in a quadratic edge decimation with options that dont check weighted quality of mesh and which keep perfect boundary. even the 250 dollars MEshCam is slower that the above method.

So, I have used this many times, and works great!

Do you ever have plans to convert this code to javascript? or java?

This is awesome!

Dec 18, 2016 - Modified Dec 18, 2016
Zoon1234micron - in reply to dhoff002

there are some java jar files online for image to stl. i think they were on Thingiverse.

BloodBlight, it is amazing! Thank you very much!

May 3, 2016 - Modified May 3, 2016

Great tool. Though I have a lot of problems when I go to edit the files in 123d or meshmixer. I need to convert the files to a solid to edit them. Which for the hp logo (round, flat, simple) for a friend, has taken a good hour so far. My guess is it has to do with the large amount of needless polygons / lines. IE the flat surface of the logo has thousands on lines on it.

I mostly edit them to make them into a keychain / logo. Usually just punching a hole.

awesome...no words..very goood job. thnk's many thnks's.

Made an account to tell you this is awesome! :D gonna have a lot of fun with it ^^
would be kinda cool to have a resolution higher than 0.1 though..

ok I have been using software like this for years, and this program is awesome, love it!

I saw an article the other day on how to do 2D > 3D with layering, based on a black and white image. I can't remember where from though.

I am trying to extrude text. This program works, but it tapers the text to a fine point, which makes it no good for printing. Is there a way of telling this program to just take anything black and extrude it exactly without tapering the image in each subsequent layer? Or is there some other single free product for that? I do not want to do multiple conversions for such a simple task. Basically input a BMP and output an STL where the black has been extruded identically to all layers.

Oct 28, 2015 - Modified Oct 28, 2015
BloodBlight - in reply to madmartian

I think I know what you mean. Try enabling “B/W” (Black & White) mode, when adjust the threshold. See the last picture that I posted as an example.

If that isn't what you mean, post a picture of what you mean.

This thing works like a charm! Thanks so much.
Selva3d seems to be pretty buggy from my experiences. Also they want $2.50 for a hq stl file?? Go with this instead!

May 2, 2015 - Modified Sep 24, 2015

As far as I know the fastest tool for doing this is http://www.selva3d.com.
It's done only in a single step, without need to download any software and it's free

GOD! WOrks Great!

Could you explain to me about under funtion?

  • Max Res(MM)
  • Spike Filter
  • Anti-Spike Filter
  • Max Res helps keep the file size down. Unless you are having slicing issues or are running out of RAM, it should be fine at the defaults.
    • The Spike/Anti-Spike filter cunts down on single/multiple pixel variants that while more true to the image will cause the print to degrade because of the nature of additive printers. Basicly, if there is a single pixel "above" the pixels around it, should it be removed to prevent an unnecessary and ugly "dot" (and sometimes string) on the top most layer of your print.

You can see it in action on the second image.

could you explain how to programe this converter?
how convert 2D image data to stl format?

Hi BloodBlight,
This tool is working great for converting 2d images into 3d. Any chance you will share the source code? Would like to make some tweaks and understand the inner workings.
Thanks again for this work!

The link is already there. :) It is under instructions and is licenced under GLP 3, so feel free to make your own fork.
There isn't really much to the code.

Ah. Thank you! I didn't notice the instructions link.

Great program, obviously, but I have to ask - is there a description of what the parameters mean? Maybe they're usual terms in the 3D print world, but at least for me they don't say much :-/
I've tried to convert a picture - the result is, interesting I'd say, but not really the way I hoped it would be - it's a picture of a person, and the whole face area is bascially flat, but not without texture, so I guess it would be interesting to print it nonetheless :-) Kind of like a relief that only makes sense from a specific point of view.

If you set the "Add to Base" to 0.5 (minimum thickness), and a target high to 1, it will make cool lithophanes. See: http://www.thingiverse.com/make:39457http://www.thingiverse.com/mak... Be sure to print with 100% infil for lithophanes with retraction turmed on, and have you Z as small as it will go (in my case, 0.05MM).
They don't look like much until you hold them to the light, then they come to life. That would be a situation where you would put in a family photo or such.
However if you want make a structure, you can feed it an image using brightness as a Z scale. A base would be just that, a base to add on even when the height is zero, and the target height would be the range from black to white. Thicker prints would be good for things like topographical maps.
The RGB allows for the selection or color channels. For example, I was trying to print three lithophanes from the same image; one in each color. Then combine them to make a full color lithophane. It didn't work out, but the functions are still there.
B/W mode would be good for making ink stamps, or cookie cutters.
The alpha channel is used for image formats that have transparency. That is harder to explain without more time.
The preview window is a representation of height. Black being the thickest (blocking more light), white being the thinnest (allowing more through).
If I ever do all the things I said I was going to do with this, I will be sure to add tooltips to it! :)

2D Image to STL Converter (Windows)

Am I allowed to sell printed objects, i created with this program?
(I will name you of course)

hehe! copyright doesnt affect work made with free programs.


It is licenced under GPL3 so there is a attribution clause, but I think that only applies to the code itself. You are free to do whatever you like with the work result from the code. :)

Though, post some pictures if possible! I always like seeing what people make. :)

Love this tool. Used it for the second time (have posted both my prints in the "made" section. I don't see the point of the border feature but I would like to see one thing made better: Whenever I print the 4 sides of my print seem to have this scalloped look - why can't the edges be perfectly straight? Even if you had to remove .1mm from the borders - I'd rather that it is a little smaller than have perfect edges than have wiggly edges.

I also found this program creates excessive polygons which are easily trimmed down with meshlab. Meshlab is free and there is a simple tutorial on how to reduce the qty of polygons on the shapeways website. Just googld "meshlab reduce polygon count" and it should be the first result. I can reduce from 3 million to .1 million polygons with zero reduction in image quality, but much faster slicing and manipulation in other software.

Oh, one thing I forgot to mention. Until my next version is out, you can add a black border to your pictures in your favorite editing program and you should get a nice border on your print. :)

I have started on the next version, but there are a lot of changes and my time has been limited lately...

On the polygon count, ya, it is an issue. There is a known bug causing lots of duplication. However, even after fixing that (need to find it) it won't be as good as an optimized mesh from MeshLab.

I may be able to add an option and call out to MeshLab, though I am not sure if it has a command line way of doing that. I will look into it...

I was originally going to have an add-border option. I never put it in, but it may be time to do that. ;)

Dec 18, 2016 - Modified Dec 18, 2016
Zoon1234micron - in reply to BloodBlight

The flat surfaces made by some kind of octree look fab, and in meshlab they disintegrate when smoothing. the vertical sides are ok and the horizontal vertices are disconnected according to meshlab. I'd love to know how to fix mesh made from it so that i can use meshlab smooth on it. The code is breathtaking, t's a very well programmed app indeed. Thanks!...

Someone on this page said he uses make solid in meshmixer, so i tried it on a mesh and found 8000 holes, which refers to overlapping vertices probably. hoping it fixes the mesh :D

Oh, dam, The MeshMixer program Crahsed!!! Your overlapping triangles are tough to repair!!!!!

So... May i venture to suggest some options? because i thought it was an Octree but it's not a very good routine...

Instead of that, i'd suggest that you make quads representing flat spaces, and then mark those pixels as having been read in an array called "Processed Pixels", because it is processing the same zone of mesh twice!... Oddly enough, i can probably write a program that can make an X3D file from heightmaps using correct mesh in Unity3D, but it will take me 2-3 days, and i dunno if i will be able to make a PC verison form it. Fix those vertices plese! they are wonkey as fukkkk. i was stoned all day today and was on an awesome mesh mission, but the program bug halted all my creative effort for the moment. Good app still! only forgot to map processed pixels in the octree. See you!

Just to update, I tried with 100% infill, 1 shell, and (oops) a 10mm overall thickness and 8 hours later it turned out great printed in white ABS with .15 layers. Thank you again for the advice

Sweet, hook us up with some pics. :)

This is probably a dumb question, but what are the recommended infill and shell settings?

I use the normal (for Cura) .8 shell (so two loops). And you want use 100% infill. A light/translucent colors PLA works good up to about 3MMs total thickness, to the other extreme of black needed to be no thicker than about 0.4MMs total thickness (so you can only get about 6 layers is for base layer is 0.1 and all others are 0.05). That is very tricky though...

Awesome thanks a lot for the advice. I'm still learning my Maker bot and trying to lessen my failed prints. I'll give those settings a shot. Thanks again, awesome utility here.

Cool, let me know. I am using an Ultimaker, so it is a bit different but should be basically the same.

Perfect. Thank you for saving me hours of converting images to STL.

Great stuff! Is there a way we can see a preview of the STL before we save it?

pX0r - in reply to

That depends... I found some web based programs for 3D preview of STL files here http://codecanyon.net/user/pushkarparanjpe/portfoliohttp://codecanyon.net/user/pus...

Not yet. Not sure if it will. :/ Adding 3D imaging proved more difficult than I would have expected. Maybe if I ever convert it to Java. Meshlab is a good tool for looking at models, and the actual export doesn't take too long.

Great program I will defintly fallow your Great work! Can you give me a trick to manipulate an image to have some part of a picture to the raft?

If you set the base height to zero and that will make absolute white have a zero height. Is that what you mean?

If you do that (as I did in the demo image), you will have to manipulate the image a big in your favorite graphics editor.

I'm not sure what you mean. I have a "base height". That would be the minimum height with the "target height" being added to that. As for an actual raft, you would have to do that is the slicer, but I wouldn't recommend it as it would distort the image.

Do you want to add a border to it? I planned on adding that feature, but it isn't in the current build.

Yeah sorry I was not clear, If I put true white its gona be at zero that's what your saying?

you mention alpha channel in you soft would it = zero?

Boder can be good i guest

here what I was playing around, Its a acdc cannon that a friend ask me to give him a part...

Um, well, helps if you select the correct file.. Ok, there is still a bug, but setting the "Add Base" to zero produces a model that the slicer should be able to handle.

Here is the STL I generated:
Cannon_4_ACD_0.zip (1007 KB)

Ya, it even made NetFab mad. :/ Well, I may take this time to add an indicator for a zero height. More to come...

Ok, so, um, ya, there is a bug. :) Let me fix that, it may be a bit.

Hehe great work !! thank's I will give it a try

Great program, but when I open it the parameters and such is cut off on the side only have a little bit of it I can see, and I can't resize the screen or shrink the image windows to see it better.

Can you post a screenshot? What is your screen rez?

My screen rez is 1024x768, but I';ve even tried changing that with no luck, this is what the screenshot looks like. As you can see it cuts off the right side, and I cannot find any way to fix it. http://i.imgur.com/kWGghtg.jpghttp://i.imgur.com/kWGghtg.jpg

Ok, I have added version 1.8.1, it should fit. : )

The next major rev will be resizable.

YEP! That's a bug. Let me see what I can do.

Hey you did a really good job!!

But I think I found a small bug. I tried to import it into OpenSCAD and realized, that the stl file is not as it should be. I tried to repair it with the netfabb cloud and the server couldn't repair it. Could you check this?

There are some known issues with surface duplication, but it shouldn't be an issue after slicing. Is there something specific you are seeing? Can you sent me an STL file?

Very impressive!
You can do this with zBrush or other premium 3d tools but you would need to prepare a better B/W image or alpha and that requires a good balance plus numerous testing..so this tool is exceptionally fast and with very good results.

Hello, I'd like to try this out but when I try and run it on Windows XP it tells me its not a valid Win32 application? I have the Microsoft.Net framework 4 Client Profile installed.

Any idea where I'm screwing up?


Fixed! :) Grab Alpha 1.8

Awesome, it works great, now time to play;-)

Well.... It seems that the great and powerful M$ has decided to no longer support XP for .Net 4.5.... I don't know that I can fix this without building a new computer (VM) that is .Net 4 and rebuilding the app in VS 2010.

Let me try a few things... :/

Hmmmm... I have an XP VM, give me a few...

THANKS for making this!

And it definitely needs a cancel button! Forgot to change the size!

Will do! I will also add a progress bar at the same time (as it just locks up until it is done right now).

Very cool. I have been using an app to translate into vector graphics etc etc to do what this does in one shot.


Glad to help! :) When I get more time I hope to add some logic that will make its results closer to that of vectoring process (clean edged in B/W).

I saw this posted in google groups and had some fun last night running this with crossover on a mac. would be great if there was a preview of the stl before saving,

If I find a simple way of embedding DirectX or something I will add it. Though I am not sure if CrossOver supports DirectX. It's been a few years since the last time I used it.