Some time ago I started creating a bunch of functions to support some procedural Image generation, I thought it could be interesting for education and also useful at some point. The functions proposed are:
Image GenImageGradientV(int width, int height, Color top, Color bottom);
Image GenImageGradientH(int width, int height, Color left, Color right);
Image GenImageSpot(int width, int height, Color inner, Color outer);
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2);
Image GenImageWhiteNoise(int width, int height, float factor);
Image GenImagePerlinNoise(int width, int height, int noiseFactor);
Image GenImageCellular(int width, int height, int cellFactor);
Unfortunately I left some implementations incomplete... Just attaching here my sample code if someone wants to take a look, test it or continue with it.
Hi 馃槃
I'm working on that, I got GenImageGradientV, GenImageGradientH, and GenImageCellular working and so I'm left with GenImageSpot and GenImagePerlin
Concerning GenImageSpot I'm not so sure about the intent of this generator... Would the result look like DrawCircleGradient ?
Hi @nounoursheureux!
What a great surprise! Someone working on this cool addition! :D
You can add any image generation function you consider interesting (marble, wood, herrington...) or any variation if considered useful.
The idea of GenImageSpot() was generating spot/sparks textures to be used by particle systems, yes, similar to DrawCircleGradient() but with star variations.
Hi @nounoursheureux!
Some references for the spot image (actually is a radial gradient):
https://stackoverflow.com/questions/3009754/algorithm-to-generate-radial-gradient
http://reference.wolfram.com/language/ref/RadialGradientImage.html.en
https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/Functions/Reference/Gradient/
To generate perlin noise, I recommend using stb_perlin.h library.
Implemented by @nounoursheureux on PRs https://github.com/raysan5/raylib/pull/309, https://github.com/raysan5/raylib/pull/311 and https://github.com/raysan5/raylib/pull/312
Great addition! :D