How do I convert jp2 bytes array to jpeg or some other image type in Flutter. I’m working with a file which is of jp2 format, but since flutter does not support this file format I’m searching for a way to convert this image to any readable image time.
I have tried This Approach and replaced with the jp2 image bites accordingly but this has worked for me. How do I solve this.
2
Answers
import ‘dart:io’;
import ‘package:jpeg_encode/jpeg_encode.dart’;
To convert a JP2 (JPEG 2000) image byte array to a more widely supported image format like JPEG or PNG in Flutter, you can use the image package. This package provides functionalities for decoding, encoding, and manipulating various image formats.
Package: https://pub.dev/packages/image
N.B: I haven’t tried it yet. I just looked through the documentation and suggesting you to try it. If it works or not, please let me know.