NASA SDO solar image
- Input
- aia171.jp2, 1,078,612 bytes, 4096×4096 8-bit grayscale, public domain.
- Output
- 1,744,569-byte JPG in 1.5 s. With width 1024 the JPG was 148,425 bytes, but still took 1.8 s because the full image is decoded first.
JP2 → JPG turns the archival format used by libraries, digitisation projects and space agencies into a file any phone, browser or upload form opens.
From real runs
| Element | Result | What happens |
|---|---|---|
| Pixels | Changed | Wavelet data is decoded and re-compressed as baseline JPEG at quality 90; NASA's 4096×4096 solar image converted in 1.5 s. |
| File size | Changed | The JPG is usually larger than the JP2, because JPEG 2000 compresses better: the 2717×3701 balloon print grew from 628,654 to 2,332,988 bytes and the solar image from 1,078,612 to 1,744,569. |
| 16-bit images | Changed | JPG holds 8 bits per channel, so 16-bit grayscale is scaled down by its bit depth: a test file with values 291 to 694 came out with greys from 70 to 174. Choose PNG or TIFF to keep every bit. |
| Grayscale | Changed | 8-bit grayscale sources such as the solar images are written as three-channel JPEGs that look identical but carry three copies of the same values. |
| Transparency | Lost | A 135×135 gray-plus-alpha logo was flattened onto white; set background for another colour. |
| XML and metadata boxes | Lost | XML boxes are dropped, so the solar image's embedded FITS header with instrument, wavelength and observation time does not reach the JPG. |
| Codestreams and JPX | Kept | Raw .j2k and .j2c codestreams and .jpf/.jpx files open like .jp2: a 2048×1556 two-layer codestream of 3,363,991 bytes converted in 1.4 s. |
| Very large scans | Changed | Decoding dominates: a 7000×9535 (67-megapixel) scan took 35 s and 1.3 GB of memory, and a 92-megapixel one 34 s and 1.8 GB. |
Wavelet data is decoded and re-compressed as baseline JPEG at quality 90; NASA's 4096×4096 solar image converted in 1.5 s.
The JPG is usually larger than the JP2, because JPEG 2000 compresses better: the 2717×3701 balloon print grew from 628,654 to 2,332,988 bytes and the solar image from 1,078,612 to 1,744,569.
JPG holds 8 bits per channel, so 16-bit grayscale is scaled down by its bit depth: a test file with values 291 to 694 came out with greys from 70 to 174. Choose PNG or TIFF to keep every bit.
8-bit grayscale sources such as the solar images are written as three-channel JPEGs that look identical but carry three copies of the same values.
A 135×135 gray-plus-alpha logo was flattened onto white; set background for another colour.
XML boxes are dropped, so the solar image's embedded FITS header with instrument, wavelength and observation time does not reach the JPG.
Raw .j2k and .j2c codestreams and .jpf/.jpx files open like .jp2: a 2048×1556 two-layer codestream of 3,363,991 bytes converted in 1.4 s.
Decoding dominates: a 7000×9535 (67-megapixel) scan took 35 s and 1.3 GB of memory, and a 92-megapixel one 34 s and 1.8 GB.
We converted our JPEG 2000 sample (42 KB) with Image engine on 2026-10-20. It took 99 ms and produced a 52 KB JPEG file, 1.2× larger than the input. The engine raised 1 warning, listed below.
Input · sample.jp2 · 42 KB
43,179 bytes
Output · sample.jpg · 52 KB
480 × 600 px, baseline
Library and archive JP2 files are often scans of printed pages. JPG keeps them as pictures; to get the text, convert to JPG or PNG and use the screenshot-to-text or scanned-book-to-epub workflow, which reads pages with AI Deep Read.
OpenJPEG + ImageMagick
opj_decompress -i scan.jp2 -o scan.png
magick scan.png -quality 90 scan.jpgopj_decompress cannot write JPEG itself. Add -r 2 to decode at a quarter of the width and height; on our 67-megapixel test that cut decoding from 15 s to 2 s.
ImageMagick
magick scan.jp2 -quality 90 scan.jpgNeeds an ImageMagick build with OpenJPEG; `magick -list format | grep JP2` shows whether yours has it.
The HTTP API and the MCP server run the exact engine this page uses (Image engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=jp2&to=jpg.
curl -X POST https://filetypeconverters.com/api/v1/convert \
-H "Authorization: Bearer $FTC_API_KEY" \
-F "file=@input.jp2" -F "from=jp2" -F "to=jpg" \
-F 'options={"width":0}' \
--output output.jpg| Key | Applies to | Type | Default |
|---|---|---|---|
| width | Writing JPEG | number | 0 |
| height | Writing JPEG | number | 0 |
| fit | Writing JPEG | contain · cover · fill | contain |
| quality | Writing JPEG | number | 90 |
| background | Writing JPEG | string | #ffffff |
| stripMetadata | Writing JPEG | boolean | true |
Chrome, Edge and Firefox do not display JPEG 2000, and Windows has no built-in viewer for it. macOS Preview opens it. Converting to JPG gives a file every device shows.
JPEG 2000 compresses photographs and scans more efficiently than baseline JPEG, so at a similar visual quality the JPG needs more bytes. Lower quality to 80 if size matters more than fine detail.
.j2k and .j2c are bare JPEG 2000 codestreams without the .jp2 box wrapper; .jpx and .jpf use the extended Part 2 file format. All of them start with known byte signatures and convert the same way here.
JPEG 2000 decoding is slow and its time grows with the pixel count: about 1.5 s for 17 megapixels and 35 s for 67 megapixels in our tests. A width setting does not speed this up.