Skip to content

p-svacha/ImageGeneration

Repository files navigation

Image Generation

This repository contains programs that procedurally generate images. All generation algorithms are my own and not dependant on external libraries. The only dependancy are libraries that provide basic functionalities for specific image formats (such as svg). Everything is written in C#. The repository contains one solution consisting of different projects, which are explained below.

Flag Generator

This project generates flags. Inspired by real-world country flags, it should generate realistic but still very different outputs. There are no input settings other than the format of the image, but the flags that are generated will be completely random.

Example Outputs


exampleFlag1 exampleFlag2 exampleFlag3 exampleFlag4 exampleFlag5 exampleFlag6

Try it out

You can see the flag generation in action by visiting my website.

How to use it yourself

The generator is a also available as a simple console application. To generate flags, simply follow these steps:

  • Download the latest Flag Generator release (see Releases)
  • Unpack the .zip file.
  • Open the CLI of your choice and navigate to the unpacked directory (containing FlagGenerator.exe)
  • Run FlagGenerator.exe with your parameters

The generator requires 4 parameters (in this order):

  • directory: The path (absolute or relative) to the directory, where your new image files with the flags will be saved.
  • type: Must be "s" or "m". s generates a single flag with a specified seed, m generates multiple random flags.
  • number: Must be a number. When generating a single flag, this number represents the seed. When generating multiple flags, this number represents the amount of flags.
  • format: Must be "svg" or "png". The format of the generated image files.

Examples (default Windows terminal):

  • To generate a single flag as a png with the seed 1312 in the current directory, run the command line with: FlagGenerator.exe . s 1312 png
  • To generate 10 random flags as svg's in the "Flags" subdirectory, run the command line with: FlagGenerator.exe ./Flags m 10 svg

Customizing predefined symbols

Flags can contain various symbols. Often these symbols are procedurally generated, but there is also a chance that a symbol of a predefined set can appear.

These predefined symbols are defined as .svg Files and are located in the Resources/CoatOfArms/ directory. A set of around 200 predefined symbols is already included in the project.

The set of predefined symbols that can appear in flags can be easily customized by just changing the content of the Resources/CoatOfArms/ directory. All files in there can appear in flags with an equal chance.

Mandala Generator

A generator to create mandalas. It is a windowed application. So to try it, simply run ../ImageGeneration/SvgMandalaGeneration/bin/Release/MandalaGeneration.exe

Example Outputs

Here are some example outputs.
exampleMandala1 exampleMandala2 exampleMandala3

About

C# project that contains various projects regarding procedural image generation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages