You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When copying sub-images between 2 DynamicImage::ImageRgb16 images, the all color data should be preserved
Actual behaviour
Only u8 worth of data (256 values) per pixel's color channel is transferred
This is because get_pixel that is used inside copy_from always returns Rgba<u8>
Reproduction steps
Hopefully it's self explanatory
Possible fix implementation direction
For my project I'm using this crude image_copy_from function I wrote myself
It doesn't work with all DynamicImage variants, but I only needed ImageRgb16
It could be expanded to all variants using a macro
Consider that:
Flat samples might hold u8, u16 or f32, depending on the variant
Different variants would have different pixel_channels values
Also, it might be more performant than the original copy_from, but I haven't tested it
"image" version: 0.25.5
rustc version: 1.84.0
target: stable-aarch64-apple-darwin
profile: release
Expected
When copying sub-images between 2 DynamicImage::ImageRgb16 images, the all color data should be preserved
Actual behaviour
Only u8 worth of data (256 values) per pixel's color channel is transferred
This is because
get_pixel
that is used insidecopy_from
always returnsRgba<u8>
Reproduction steps
Hopefully it's self explanatory
Possible fix implementation direction
For my project I'm using this crude
image_copy_from
function I wrote myselfIt doesn't work with all
DynamicImage
variants, but I only neededImageRgb16
It could be expanded to all variants using a macro
Consider that:
u8
,u16
orf32
, depending on the variantpixel_channels
valuesAlso, it might be more performant than the original
copy_from
, but I haven't tested itCode:
The text was updated successfully, but these errors were encountered: