Extract equation from image - reverse graph plotting?

I’m looking for a tool that can convert simple curve from lets say .svg or similiar format (could be bitmap also) and output simplified math equation.
I don’t care how the input should be prepared as long as it can be made with generic vector or bitmap software.

I wan’t output in readable y = sin x like format. Variable degree of precision would be a bonus.

what do you need this for? i have never heard of a software like that. maybe a neural network would have to be trained for it?

I’m looking for a faster way of creating complex shapes for masking purposes in shader editor.
You can create basic shapes with nodes with no problem:

The caveat is that with complex shapes this require a lot of math knowledge.

So I was thinking like:

  1. Extract, draw, or make shape you want to make in generic 2d software. Or even bake it in Blender.
  2. Reverse plot it.
  3. Get the equation.
  4. Use nodes in shader editor to recreate the shape based on the equation.

The upside is that you end with completly procedural shape.

I like your thinking… would like to know if this exists as well. Personally I would just design them in inkscape and slap them on uv space in the shader editor. Obviously that’s less animatable than a parametric shape… but it’s probably easier.

Easier, but if mesh is not unwrapped (or can’t be - due to size) that won’t do. Take procedurals as example.
Having the ability to draw shapes on procedurally created meshes with procedural shaders would be great.

That being said you can use any space for this : you can even cutout 3D shapes using two images, like some did back in the day when Cycles first got volume rendering… better procedurals would simplify so much. I’m thinking primitives, patterns etc. I know I’m not helping much ! Sorry.

This seems like something that would only really be of use for stuff like #nodevember or if you like doing things purely for the challenge.

Draw a complex shape and the proposed software will either fail to give you an equation, or it will be insanely complex. The amount of time required faffing about trying to set up Math nodes (and get them in the right order of operation) would dwarf the amount of time required just to take your image from step one and just use it.

The procedural or parametric aspects of it fall apart with complex equations. To alter something you’ve “input” you require a familiarity with the mathematics. If you have that then the whole point kinda falls apart.

My preference instead would be for Blender to have some nodes similar to the ones in Substance Designer, where you can draw primitive shapes (not to mention all their wonderful procedural noises and stuff)

That could depend heavily on the precision. Shapes can me aproximated, and equations could be optimised.
The following is based on Fourier, but there is a lot other math to use:


Making the last one is overkill, but simpler shapes are a lot more viable to draw with nodes.

If you are starting from rough bitmap that is useless for final render and want to have full procedural shape in the end that is not wasted effort. There is a lot of shapes useful for masking that are extremly hard to get from procedural workflow in Blender right now.

No it doesn’t. I’ve implemented couple 3d fractals, and I can tweak a lot of parameters along the way - and I don’t know shite about math behind them. Manually recreating complex shapes can give a lot of visual feedback along the way - that is all I need.

Yeah. Mine too, but this is wishful thinking at this moment, and math nodes exist in Blender right now.

there are many math sites giving 100’s of equations
for 2D curves or 3D or surfaces

don’t know any soft that can read a curve on an image and give back the equation for it !

i guess it would be a complex program or some pattern recognition algo which might end up being complicated too

may be someone has seen something like that or working on it

happy bl

i came across this curve fitting tool:


but i am not sure if “curve fitting software” goes into the right direction? (i couldn’t try it yet since i am on my mobile phone and it doesn’t seem to work there.)
1 Like

Training a neural network would probably be the way to go here. Wish I could help with that but there is a growing community of enthusiasts on Youtube that try to do a lot of stuff with simple neural networks. If there are sites that provide shapes and equations they could serve as training material. Having an add-on like that for Blender would rock. :monkey_face: :+1:t4:

1 Like