pub trait BufferStripAlpha<Pmut, ContainerMut>where
Pmut: Pixel,
ContainerMut: DerefMut<Target = [Pmut::Subpixel]> + AsMut<[<Pmut as Pixel>::Subpixel]>,{
// Required method
fn strip_alpha(&mut self) -> Result<(), Error>;
}Required Methods§
Sourcefn strip_alpha(&mut self) -> Result<(), Error>
fn strip_alpha(&mut self) -> Result<(), Error>
Remove this images alpha channel by setting it to the maximum value for every pixel.
Does not modify the underlying type.
§Errors
NoAlphaChannel: self does not have an alpha channel
§Examples
use image::open;
use image_blend::{BufferStripAlpha};
// Load an image and remove its alpha channel
let mut img2_dynamic = open("test_data/2.png").unwrap();
let mut img2_buffer = img2_dynamic.to_rgba16();
img2_buffer.strip_alpha().unwrap();
img2_buffer.save("tests_out/doctest_buffer_stripalpha_result.png").unwrap();