encode abstract method
Encode an image to an image format.
If singleFrame is true, only the one Image will be encoded;
otherwise if image has animation, all frames of the image will be
encoded if the encoder supports animation.
Implementation
Uint8List encode(Image image, {bool singleFrame = false});