Convert JP2 to WebP
Two formats that were both meant to succeed JPEG, twenty years apart. One won the archives and the other won the browsers, and this conversion is the bridge between those two worlds — for when a collection that was digitised properly needs to go on a website.
Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.
Add to Chrome — freeDrop your JP2 file here, or click to browse
Up to 50 MB. Deleted automatically after 30 minutes.
What it does
- The smallest of the three JP2 conversions here
- Read by every browser released since 2020
- Encoded at quality 82, a number we publish
- Reads .jp2, .j2k and .jpf alike
How to use JP2 to WebP
- 1
Add the JP2
Drop it in. The .jp2, .j2k and .jpf variants are all the same codec and all are read.
- 2
Encoded as WebP
Quality 82. This is a lossy encode, which is the point — it is where the size advantage comes from.
- 3
Publish it
Every browser since 2020 reads WebP. Keep the JP2 as your master.
How it works
The JPEG 2000 codestream is decoded through OpenJPEG and re-encoded as WebP at quality 82. Only the codec changes; nothing is resized or resampled.
Two attempts at the same job
JPEG 2000 and WebP were both built to replace JPEG, and they took the same approach to the problem and opposite approaches to the politics.
JPEG 2000, 2000. Technically superior — wavelets instead of block transforms, a true lossless mode, progressive decoding at several resolutions from a single file. Its patent situation was unclear at the moment browsers were choosing what to implement, and its decoders were slow on the hardware of the day. It won the institutions and lost the web.
WebP, 2010. Technically good rather than remarkable, and released by Google under a permissive license with a working implementation attached. It won the web and has essentially no presence in archives.
So a digitised collection tends to live in the format nothing can display, and publishing it means crossing between the two. That is this conversion.
Master and derivative
The distinction archives make is worth borrowing even for a small project.
A master is the best copy that exists: lossless, large, kept forever, never edited. A derivative is made from the master for a purpose — a thumbnail, a web image, a print proof — and is expected to be regenerated whenever the purpose changes.
The JP2 is your master. This WebP is a derivative for the web. If you later need a different size, a different format, or a better quality setting, you make a new derivative from the master rather than from this file.
Deleting the JP2 after converting is the one mistake this page exists to prevent.
Which JP2 conversion to pick
| purpose | file |
|---|---|
| a website | this one |
| an email, a form, older software | /jp2-to-jpg |
| a lossless working copy, or a page of text | /jp2-to-png |
| long-term storage | keep the JP2 |
Sizing before you convert
One practical note, because it is the mistake that makes archival images slow on the web.
A digitised page or plate is frequently 4000 to 8000 pixels on the long edge — correct for a master, absurd for a web page that displays it at 900. Converting at full size gives you a WebP that is small compared to the JP2 and still far larger than the page needs.
Resize first, then convert, and pick the size from how the image is actually displayed: roughly twice the CSS width it will occupy, so it stays sharp on a high-density screen. For a 900-pixel column that is 1800 pixels, not 6000.
If the images need to be zoomable, the answer is not one enormous file but a tiled viewer generated from the master — which is exactly what JPEG 2000's multi-resolution decoding was designed for, and a reason to keep the JP2.
Examples
A digitised collection going online
The archive keeps its lossless master. The public site serves something a browser downloads quickly.
A scanned illustration for an article
Smaller than the JPG at the same visual quality, which adds up across a page of them.
Frequently asked questions
Why not just serve the JP2?
Because no browser will display it. JPEG 2000 had brief support in Safari and nowhere else, and that has gone. A JP2 linked from a web page either downloads as a file the visitor cannot open or shows nothing at all. If the images are going on a website they have to be converted to something browsers read, and WebP is the smallest of those.
Is WebP better than JPG for this?
Usually, and by a worthwhile margin — commonly 25 to 35 per cent fewer bytes at a quality nobody can distinguish. For a page carrying dozens of scanned plates that is the difference between a site that feels quick and one that does not. The exception is anywhere outside a browser: email clients, older software and some content systems still do not read WebP, so use /jp2-to-jpg for those.
What about the text in a scanned page?
Lossy encoding of any kind softens sharp edges, and black text on white paper is nothing but sharp edges. WebP handles it better than JPEG does, but if the point of publishing is that people can read the text, /jp2-to-png is lossless and the honest choice. Reserve this for pictures, plates and illustrations rather than for pages of type.
Will this replace my archival copy?
It should not, and the page says so deliberately. A JP2 from an archive is very often lossless and is the version with all the information in it. This produces a lossy derivative for publication — a copy for the public, not a replacement for the deposit. Keep the master; serve the WebP.
Does my file leave my computer?
Yes. JPEG 2000 decoding needs a codec library that runs on our server rather than in a browser. Your file and the result are both deleted within 30 minutes by a timer, and nothing is stored, indexed or examined.
Further reading
- Cropping a JPEG Re-Encodes the Part You KeptCropping feels subtractive — you are taking pixels away, not changing them — so the part you keep should arrive untouched. In a JPEG it usually does not, and the reason is the same one that makes rotation lossy.
- Rotating a JPEG and Back Changed 560,770 PixelsRotating a photo is not editing it. Nothing about the picture changes, only which way up it is — so it is reasonable to expect the pixels to survive. With most tools they do not, and the loss is the same kind a re-save costs.
- We Re-Saved a JPEG Twenty Times and Nothing HappenedEveryone has heard that a JPEG gets worse every time you open and save it, and most people have seen the artwork made by re-saving an image five hundred times to prove it. So we measured it properly. Re-saving at the same quality, twenty times, changed the image by nothing at all — and then we found the conditions where it degrades badly.