r/howdidtheycodeit • u/Gladly-Unknown • Mar 25 '21
Question Questions about Algorithmically generated pixel art
First I would like to point out that I am not a programmer, but I am not fully retarded (I hope).
I understand that the basic idea is to determine certain attributes and create an artwork for each then overlay the different images to get the final result or a more complex way would be "procedural generation".
But how is that done exactly? javascript? python?
what if I want the software to also output a .csv file to keep track of each artwork and its attributes?
I am not sure if this is the right place to ask, but how long would it take me to learn this?
Edit: An example for a static image would be https://larvalabs.com/ or https://chubbies.io for a give which I assume is the same but we'd have to create multiple frames to get the animation effect.
Thank you in advance for your input.
12
u/ctothel Mar 25 '21
Based on your links the bulk of the work would be in drawing the options for the layers. Glasses, eye shape, eye colour, beard, etc.
After that the layering is fairly simple. An experienced dev could probably whip something up in a day or two, but it’d take you weeks to get there from zero experience. Weeks at a minimum.
7
u/d0ntgoback Mar 25 '21
Some examples of what you want would be helpful
6
u/joonazan Mar 25 '21
Procedural generation just means that something is generated by following a procedure. Typically that procedure starts with a number called the seed and in your case it ends with a picture.
You can read about various techniques online, for example https://thebookofshaders.com/13/ but in the end your creativity is needed to invent a method of generating what you want to create.
8
u/fiskfisk Mar 25 '21
In either case the chosen language isn't usually relevant. It's just a choice for whatever you're comfortable with (and in some cases, which libraries are available for a specific use case you want to solve).
4
u/Wagnerius Mar 25 '21
You may want to look at my stuff : https://lbarret.itch.io/rectitude
The core idea is to chain operations on rectangles to generate an image. The operations have parameters that you can change. Any change will then trigger the (re)generation of the final output. ( It becomes a lot more manageable if you group a common sets of operations and merge it as one, but this is not absolutely necessary ).
In my case, this is a mix of python, c, and rust. But the language is not the important part.
2
u/[deleted] Mar 25 '21
Maybe r/proceduralgeneration can help you
0
u/kernalphage Mod - Generalist Mar 26 '21
If you want to get your hands dirty, I'd recommend canvas-sketch by MattDesl. It's a nice all-in-one package for a sort of 'visual REPL'.
I tend to group my procedural images into functions that draw different parts of the picture, and use that to slowly build complexity. Eg:
If you want to keep track of the parameters you used to generate each piece, it lets you output a matching JSON file for each png/svg you export.
(Also, I'm new to Moderating so as a warning: Please don't use 'retarded' in that way, it's a super outdated word, especially in this context)