Skip to content

Image "Pixels" Channel Documentation #459

@bnpfeife

Description

@bnpfeife

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions