gltf icon indicating copy to clipboard operation
gltf copied to clipboard

Image "Pixels" Channel Documentation

Open bnpfeife opened this issue 4 months ago • 1 comments

Hello,

I noticed some misleading documentation in the Image struct. The pixels field claims that there are 8 bits per channel; however, I do not believe this is the case. If we look at the implementation of Image::new, we see that the pixels field is constructed with DynamicImage::into_bytes. The implementation of into_bytes seems to just cast the pixel data to Vec<u8> without any pixel format conversions.

I suspect that this hasn't been caught, because most images are 8 bits per channel. However, it would be misleading for other pixel formats. I think the docs should be updated to remove the (8 bits per channel) part. I would appreciate a second look to make sure my logic here is correct.

Thanks!

bnpfeife avatar Aug 20 '25 05:08 bnpfeife

I agree this is misleading, thanks for pointing this out.

alteous avatar Aug 29 '25 09:08 alteous