Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 809 Bytes

create-empty-image.md

File metadata and controls

41 lines (30 loc) · 809 Bytes
title timestamp author published description tags
Create empty image with the image crate of Rust
2023-10-01 10:30:01 -0700
szabgab
true
Using the image crate of Rustlang it is very simple to create an image and save it in any format you like.
image
empty
RgbImage
ImageBuffer
save

In this example we create an empty image using the image crate of Rust.

This is the result:

Yes, this is just a black square.

cargo new create-empty-image
cd create-empty-image
cargo add image

Results in the following file:

{% include file="examples/create-empty-image/Cargo.toml" %}

Then we add the code:

{% include file="examples/create-empty-image/src/main.rs" %}

and run

cargo run