Python wrapper around TinyEXR and stb_image
Project description
Simple Image IO
A very simple C# wrapper to read and write RGB images from / to various file formats. Supports .exr via tinyexr and a number of other formats (including .png, .jpg, .bmp) via stb_image and stb_image_write.
Dependencies
All dependencies are header-only. Building requires
- a C++11 (or newer) compiler
- CMake
- .NET 5.0 (or newer)
Building on Windows and Linux
Build the C++ low level library by running:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd ..
To compile and run the tests (optional):
dotnet test
That's it. Simply add a reference to SimpleImageIO/SimpleImageIO.csproj
to your project and you should be up and running.
Building on other platforms
In theory, the package works on any platform. However, the native dependencies have to be built for each. Currently, the workflow has been set up and tested for x86-64 versions of Windows, Linux (Ubuntu 20.04) and macOS 10.15. Other platforms need to be built from source. For these, the SimpleImageIO.csproj file needs to be adjusted, instructions can be found in the comments of that file. The process should be a simple copy&paste operation, provided nothing goes south when building the C++ library.
Usage example
The following creates a one pixel image and writes it to various file formats:
RgbImage img = new(width: 1, height: 1);
img.SetPixel(0, 0, new(0.1f, 0.4f, 0.9f));
img.WriteToFile("test.exr");
img.WriteToFile("test.png");
img.WriteToFile("test.jpg");
Reading an image from one of the supported formats is equally simple:
RgbImage img = new("test.exr");
Console.WriteLine(img.GetPixel(0, 0).X);
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SimpleImageIO-0.2.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cd682a69af41246514527448b58714480cbe8b226ee42a800e9c02cf8e9aaa6 |
|
MD5 | c7e382cccf9b480dde01cd74225aafd8 |
|
BLAKE2b-256 | f64e88b089440398d99e16a5900cb752d9a7dae89e30a0f83305398517a55967 |