Site iconJava PDF Blog

How to choose JPG versus JPEG2000 for image files

Since we started to support both JPG and JPG2000 as image file outputs in our software, we have found that this is a very common question. So I thought a brief general explanation would be helpful.

JPG versus JPEG2000

JPG files have the file endings .jpg .jpeg .jpe .jif .jfif .jfi while JPEG2000 files finish with .jp2 .jpx .j2c .j2k .jpf. So kitten.jpg is a JPG file and kitten.jp2 would be a JPEG2000 version.

JPG is the original standard and JPEG2000 is the newer format. Both are open ISO standards with documentation online. If you want to read up, good starting points are https://jpeg.org/ or https://jpeg.org/jpeg2000/

JPEG2000 has some interesting new features, but it is not a direct replacement for JPG – there are still things JPG does better and not all tools currently support JPEG2000. The documentation online tends to be very technical and tell you about lots of the features (JPEG2000 ROI for example) but not the pros and cons.

So I asked our development team to summarise for me in reasonably non-technical language the benefits of each.

JPG is really good for

JPG is not so good for

How does JPEG2000 compare?

Which Image format to use?

JPG where I need to ensure it works on everything, have small images and do not need to get the smallest possible file sizes.

JPEG2000 where I have fast machines, want the best compression and am confident the users will be able to view them.

How to read and write JPEG and JPEG2000 images in Java?

We have tutorials on