Generate a fake JPG or PNG image in any size between 1 KB and 2 GB.
This was made for generating big files that pose as images for testing purposes (for testing an image upload feature in an app, for example).
.NET Core 3.1
Install-Package FakeImageGenerator
Simply build the solution in Visual Studio 2019.
Use Generator
class to generate a fake image like this:
var generator = new Generator();
generator.Run(10000000, "Png", "C:/"); // generate a 10MB PNG image
Or if you want a byte array:
var generator = new Generator();
var array = generator.Run(10000000, "Png"); // generate a 10MB PNG image
If you want to generate fake images for tests:
- For Xunit theories tests download the FakeImageGenerator.Xunit package.
- For MSTest data tests download the FakeImageGenerator.MSTest package.