3 ms·
I've done some things like this before, with lines, ellipses, etc., but the brush strokes are neat, and look much better. I wondered what fancy brush engine it
by mkl 6y ago
I've done some things like this before, with lines, ellipses, etc., but the brush strokes are neat, and look much better. I wondered what fancy brush engine it was using, but it turns out just four images of brush strokes do quite a good job!
It would probably be possible to use a brushstroke engine like say Krita's to do better, but I don't know how accessible that is outside the GUI, and the CPU implications might end up challenging (often many strokes need to be randomly generated before you get one that's an improvement worth keeping).
- regularfry 6y agoGenerating images is interesting because you can use the difference between the original and the last generation to bias the search, which can cut down the number of strokes you need to test. On the other hand, what's happening here is also slightly different to what people usually mean by genetic optimisation in that it looks like it's only the most recent brush stroke that's being randomised. Normally you'd keep the entire stack of strokes around as a genome and allow any of them to mutate, which means you'd need to do a full render at every generation, as opposed to just blitting a single stroke per generation.
- regularfry 6y agoOn reading the code, I think the latter is actually what it's doing. Might have a bit of a play with this, it looks fun.