fn encode_png_bytes( packed: &[u8], width: u32, height: u32, has_alpha: bool, ) -> Result<Vec<u8>, String>