encodeToData
Encodes Image pixels, returning result as Data.
Returns null if encoding fails, or if format is not supported.
On a macOS, encodedImageFormat can additionally be one of: EncodedImageFormat.ICO, EncodedImageFormat.BMP or EncodedImageFormat.GIF.
quality is a platform and format specific metric trading off size and encoding error. When used, quality equaling 100 encodes with the least error. quality may be ignored by the encoder. PNG is lossless, so quality is ignored for PNG. Use pngCompressionLevel to control PNG compression.
pngCompressionLevel is used only for PNG and is passed as zlib compression level. It must be in the 0..9 range, where 6 is the default, 9 is maximal compression, and 0 skips zlib compression.
Return
encoded Image, or null
Parameters
encoder specific metric with 100 equaling best, ignored for PNG
PNG zlib compression level in 0..9