If ColorU8 derived AnyBitPattern, I'd be able to replace the transmute calls in this method with bytemuck's cast and remove the unsafe code. This will be possible even if bytemuck becomes an optional dependency; it'll just have to be guarded by cfg_attr.
https://github.com/Pr0methean/OcHd-RustBuild/blob/main/main/src/image_tasks/png_output.rs#L312-L324