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
The Frames returned by AnimationDecoder are hardcoded to contain Rgba8Images, which is generally suboptimal when working with animated PNG or WEBP images:
if the source image has no alpha channel, this imposes an extra conversion;
16-bit APNGs are unsupported because of this.
Would it make sense to have Frame contain a DynamicImage instead of a Rgba8Image, despite the fact that this is a breaking change? Existing users of the API could easily upgrade by doing the conversion to Rgba8 manually with .into_buffer().into_rgba8() or similar.
The text was updated successfully, but these errors were encountered:
It might be doable in a backwards-compatible way by adding a new method next to into_frames, like into_frames_dynamic().
However, I don't think it has practical utility besides optimization for opaque RGB8. AFAIK WebP doesn't have 16-bit coding — lossless is 8-bit-only, and VP8 implementations don't even use full range in 8 bits. PNG compression is pretty bad in 16 bits.
You're right that this would be mostly for optimization purposes; another theoretical use-case would be grayscale APNGs, but I'd be surprised if they actually exist in the wild ^^
The
Frame
s returned byAnimationDecoder
are hardcoded to containRgba8Image
s, which is generally suboptimal when working with animated PNG or WEBP images:Would it make sense to have
Frame
contain aDynamicImage
instead of aRgba8Image
, despite the fact that this is a breaking change? Existing users of the API could easily upgrade by doing the conversion to Rgba8 manually with.into_buffer().into_rgba8()
or similar.The text was updated successfully, but these errors were encountered: