Raylib: [textures] Procedural Image generation

Created on 27 Jul 2016  路  4Comments  路  Source: raysan5/raylib

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.

gen_textures_image.zip

enhancement help wanted

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings