Map<String, Object?> toJson() => { 'format': format, 'width': width, 'height': height, 'data': base64Encode(data), };