pub fn encode_image<T, P, Map>( map: &Map, map_extent: &Extent2i, ) -> ImageBuffer<P, Vec<<P as Pixel>::Subpixel>>where T: Into<P>, Map: for<'a> Get<&'a Point2i, Data = T>, P: Pixel + 'static,