Open emirror-de opened 1 week ago
I am now using this workaround:
let tmp_img = source.to_image();
let mut dest = DynamicImage::new(tmp_img.width(), tmp_img.height(), img.inner().color());
dest.copy_from(&*source, 0, 0)?;
But this feels a bit complicated and suboptimal?
This is related to https://github.com/image-rs/image/issues/1952. The DynamicImage
enum implements GenericImage<Rgba<u8>>
even though it really shouldn't
Ahh I see. Thanks for the hint.
I am using the code below to transform a grayscale image from
SubImage<&DynamicImage>
toDynamicImage
. Is there something I am missing during this conversion?Expected
I would expect the new
dest
image to beL16
as well.Actual behaviour
dest
image is ofRgba8
.Reproduction steps