Gen2D is a command-line interface (CLI) tool that simplifies the generation of 2D art in Go.
This tool is built on top of the generativeart library.
Build and run the application:
go build -o ./gen2D && ./gen2D circles
This command creates a directory called "output" containing your generated artwork.
On macOS, you can view the generated files using:
open output/*
To see all available options, run:
./gen2D
Some example commands to try:
./gen2D random-shapes
./gen2D perls
The repository includes a sample Makefile to help you generate art. To create artwork using all the commands in the Makefile:
make -f sample-Makefile all
You can customize your artwork using configuration files. Here's an example configuration file (in the input folder):
{
"out": {
"dir": "output"
},
"canvas": {
"width": 300,
"height": 300
}
}
The configuration file allows you to set:
- Output directory location
- Canvas dimensions
To use a configuration file:
./gen2D circles grid -c 10 -f input/config.json
This command generates 10 images using the specified circle configuration.
To contribute:
- Create an issue describing the proposed change
- Submit a pull request with your implementation
- Generate a configuration file for each image, documenting the parameters used for future recreation
- Add a flag to specify the output directory
- Create subdirectories with timestamps for each generation run
- Switch from JSON to TOML configuration files for improved readability and conciseness
This project is licensed under the MIT License. See the LICENSE file for details.