I was wondering if I could do the following with python in Blender:

  1. Import Image into Blender with addon
  2. Subdivide the plane and make a lot of new objects which are fragments of the original
  3. Check the color of each fragment and possibly delete

I know how to do steps 1 and 2, but I have no clue how to do the third step. The goal, in general, is to import an image and delete all the parts that are a certain color, in this case white. I then want to extrude the image, so just using transparency doesn't work.

I would appreciate any help. Thanks in advance.


1 Answer 1


If you're just trying to extrude a silhouette of an object, doing it with a subdivided plane is probably the worst option (you'll end up with potentially useless geometry, I'm assuming this isn't what you want).

Your best bet here is probably to import the image as a background image through this interface in the right panel.

Background image interface

Then go into an orthographic camera mode and create geometry over it.

Another option could be to open the picture in a program like Adobe Illustrator, automatically or manually trace it to create a path, export as SVG and import to use as geometry in Blender.

  • $\begingroup$ I've looked into using an svg, but the issue is that I wanted the entire process to be able to be done via python, so I can replicate it with any image. Is there any way that I can do the tracing automatically with good results? I looked into using Inkspace, but the automatic trace wasn't good enough for the image. Also, I'd like to keep the colors of the image, so if I do get a trace, can I use that somehow? Sorry for the lack of clarification originally. $\endgroup$
    – Nan
    Commented Aug 23, 2016 at 4:03
  • $\begingroup$ I'm sure there are libraries for doing this entirely through Python, and Illustrator has batch automation. And yes, SVGs are imported as 2d curves with the color in their material slot. $\endgroup$
    – justinbot
    Commented Aug 23, 2016 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .