I am trying to convert a Rgba image buffer to RGB image buffer, used in Rust image cargo.
Basically I am converting ImageBuffer<Rgba,Vec> to ImageBuffer<Rgb,Vec>
I have several options like:
- Create a new buffer and loop through every pixel to discard the alpha channel.
- Convert the old buffer to Dynamic image, use the to_rgb8() method, and convert back to a new image buffer.
Both option seems to affect performance a lot.
So does anyone have experience with this and can maybe shred light on a good method to maximize performance? Thank you.