https://github.com/Computr1x/ExNihilo
ExNihilo - modern, powerfull and flexible image creation library.
https://github.com/Computr1x/ExNihilo
captcha captcha-generation csharp image-generation procedural-generation
Last synced: 6 days ago
JSON representation
ExNihilo - modern, powerfull and flexible image creation library.
- Host: GitHub
- URL: https://github.com/Computr1x/ExNihilo
- Owner: Computr1x
- License: apache-2.0
- Created: 2022-07-21T11:17:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-19T18:36:46.000Z (over 1 year ago)
- Last Synced: 2024-11-08T05:39:56.414Z (5 months ago)
- Topics: captcha, captcha-generation, csharp, image-generation, procedural-generation
- Language: C#
- Homepage:
- Size: 6.5 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- project-awesome - Computr1x/ExNihilo - ExNihilo - modern, powerfull and flexible image creation library. (C# #)
README
[](https://github.com/Computr1x/ExNihilo/actions?query=workflow%3ABuild)

[](https://www.nuget.org/packages/ExNihilo)
[](http://www.apache.org/licenses/LICENSE-2.0.html)This is an extremely powerful tool for creating procedural images from scratch. You can use it to generate captchas, datasets to train neural networks or unique game mechanics - in other words, for anything your imagination can do
## Features
- Multi-container system for processing visual entities without the need for complete redrawing
- Full randomizability of all properties of all entities - from color and font size to the strength of the distortion/blur/any effects
- A huge number of effects for post-processing images - from color correction and geometric distortion, to sharpness and pixelation modifiers
- Ability to write code with confinient [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) and the classic object-oriented approach
- Full cross-platform without being tied to any specific operating system## Getting started
For detailed illustrated code examples, we recommend you go to the [Wiki section](https://github.com/Computr1x/ExNihilo/wiki). However, here is a sample:
```csharp
var fontFamily = new FontCollection()
.AddSystemFonts()
.GetByCulture(CultureInfo.CurrentCulture)
.First();
Size containerSize = new(512, 256);Container container = new(containerSize)
.WithContainer(
new Container(containerSize)
.WithBackground(Color.White)
.WithVisual(
new Text()
.WithPoint(new Point(256,128))
.WithFontSize(100)
.WithRandomizedContent(content => {
content.WithLength(5);
content.WithCharactersSet(StringProperty.asciiUpperCase);
})
.WithRandomizedBrush(10)
.WithFontFamily(fontFamily)
.WithType(ExNihilo.Utils.VisualType.Filled)
)
);new ImageSaver(
new ImageGenerator(container)
.WithSeedsCount(3)
.Generate())
.WithOutputPath("./")
.CreateFolder("Results")
.Save();
```## Example projects
You can always find several test projects with detailed code explanations in a directory [/examples](https://github.com/Computr1x/ExNihilo/tree/master/Examples/):
| Project | Description | Result |
|--------------------|-------------|-------------------------------------------------------------------------------------------------------------------------|
| [Simple](https://github.com/Computr1x/ExNihilo/tree/master/Examples/Simple) | The example shows basic container operations such as working with containers, text, generating and saving an image. |  |
| [AdvancedCaptcha](https://github.com/Computr1x/ExNihilo/tree/master/Examples/AdvancedCaptcha) | Advanced work with multiple visual objects, randomization of their parameters and post-processing effects. |  |
| [TwoLanguage](https://github.com/Computr1x/ExNihilo/tree/master/Examples/TwoLanguage) | This example shows how to create a image with different fonts for rendering text in two languages. |  |
| [WPF](https://github.com/Computr1x/ExNihilo/tree/master/Examples/WPF) | This example shows how to create and display image in WPF project. | |# License
ExNihilo is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0 "Apache License, Version 2.0")
The licenses of the used libraries can be found [here](https://github.com/Computr1x/ExNihilo/blob/master/THIRD-PARTY-NOTICES.TXT)