How to render Jpeg2000 (.jp2) to an ImageView?

1.7k Views Asked by At

How to Render Jpeg2000 (.jp2) to ImageView in Android

I have been working from long time but i couldn't found Appropriate Solution , I found few Names of Rendering image jp2 image but not able to find reference of it

  1. JJ2000
  2. JMagic
  3. JAI - Java Advanced Imaging

Please Help me out with the solution

2

There are 2 best solutions below

0
On

I have Found Solution Using JJ2000

Many other libraries are using AWT code or NDK files i think this is the simpler way to render JP2 to imageView

Reference urls ::

  1. https://bitbucket.org/jchauhan/jj2000-android

  2. https://github.com/soft-studio/NFC_DriversLicenseReader

Happy Coding

0
On

You can use Gemalto's JP2 for Android library, based on OpenJPEG.

Add the dependency to your build.gradle file:

implementation 'com.gemalto.jp2:jp2-android:1.0'

and use the following code to convert the JJ2000 bytes to an Android bitmap:

Bitmap bitmap = new JP2Decoder(jj2000Bytes).decode();
imageView.setImageBitmap(bitmap);