pub fn encode_image_as<P, Container>(
image: &ImageBuffer<P, Container>,
format: ImageFormat,
) -> ImageResult<Vec<u8>>where
P: Pixel + PixelWithColorType,
[P::Subpixel]: EncodableLayout,
Container: Deref<Target = [P::Subpixel]>,