toPNG :: Film -> BS.ByteString
toPNG (Film (w, h) _ p) = P.encodePng (P.Image w h (V.fromList $ map (\ (Pixel s w) -> round (s/w)) [p!(x,y) | y <- [h-1,h-2..0], x <- [0..w-1]]) :: P.Image P.Pixel8)
toPNG :: Film -> BS.ByteString
toPNG (Film (w, h) _ p) = P.encodePng (P.Image w h (V.fromList $ map (\ (Pixel s w) -> round (s/w)) [p!(x,y) | y <- [h-1,h-2..0], x <- [0..w-1]]) :: P.Image P.Pixel8)
toPNG (Film (w, h) _ p) = P.encodePng (P.Image w h (V.fromList $ map (\ (Pixel s w) -> round (s/w)) [p!(x,y) | y <- [h-1,h-2..0], x <- [0..w-1]]) :: P.Image P.Pixel8)