5 ms·
Genetic Drawing
- jonluca 6y agoThis is so cool. Does anyone have other examples on GitHub of procedurally generated art like this?
- snakeboy 6y agohttps://github.com/fogleman/primitive https://github.com/fogleman/primitive is a favorite of mine.
- RBerenguel 6y agoI don't know if it applies, but I post all my sketches on Github (but I use p5js, Javascript's Processing flavour): https://github.com/rberenguel/sketches https://github.com/rberenguel/sketches If you take a look at reddit.com/r/generative (and /r/proceduralgeneration) you can find interesting projects and ideas, and sometimes people also post their code.
- mkl 6y agoI'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.
- rlp 6y agoVery nice! The sampling mask makes a big difference. I played around some with creating shaders in Unity for this type of thing last year. I liked how it looked on still frames, but I was never quite satisfied with the results for movement.
- mkl 6y agoIs this generating each frame from scratch, or are they aware of the frame before? With the genetic drawing method linked, you could start with the current frame, and add brush strokes to the regions that are different to make it more like the next frame. That way things that aren't changing would stay still and not flicker.
- rlp 6y agoYes, it's aware of the previous frame. I believe I used some kind of motion "heat map" that would indicate where the changes were needed based on accumulated deltas that would gradually decay. However, I still had to keep the brush strokes on a reasonably regular-ish grid to get enough paint brush coverage for real-time rendering. Also, if they were too randomly placed, the image jumped around too much.
- dmos62 6y agoHow is this performance-wise? Would be cool to apply to a video, where you'd drop ~4/5 frames and then start drawing, but instead of starting with a blank for each frame start with the previous frame.
- deleted 6y ago[deleted]