Solar observatory image
- Input
- aia171.jp2, 1,078,612 bytes, 4096×4096 8-bit grayscale.
- Output
- 5,198,403-byte grayscale PNG in 16 to 24 s across two runs.
JP2 → PNG is the lossless way out of JPEG 2000, the one to use when the image carries 16-bit data, transparency or a palette you need to keep.
From real runs
| Element | Result | What happens |
|---|---|---|
| 16-bit samples | Kept | The 64×64 16-bit grayscale test file was written as a 16-bit PNG with the same values, 291 to 694 (3,932 → 4,807 bytes). |
| Alpha | Kept | An RGBA codestream and a gray-plus-alpha logo kept their transparency as RGBA and LA PNGs. |
| Palette images | Kept | A 768×512 colour-mapped conformance file stayed a palette PNG of 222,402 bytes. |
| Resolution box | Kept | The display resolution stored in the JP2 header (72 dpi in the relax.jp2 sample) was written to the PNG's pHYs chunk. |
| File size and time | Changed | Lossless PNG is big and slow for large images: the 4096×4096 solar image gave 5,198,403 bytes in 16 to 24 s, the 2717×3701 balloon print 13,126,488 bytes in 50 s. |
| Very large scans | Lost | A 67-megapixel scan did not finish within our conversion time limit as PNG, while JPG finished in 35 s. Use JPG, or resize with width, for scans that big. |
| Lossy JP2 artefacts | Kept | If the JP2 was saved lossy, its wavelet blur and ringing are copied into the PNG exactly; PNG adds no loss of its own. |
| XML boxes | Lost | Embedded XML, including the FITS header in solar observatory files and rights statements in archive files, is not carried over. |
The 64×64 16-bit grayscale test file was written as a 16-bit PNG with the same values, 291 to 694 (3,932 → 4,807 bytes).
An RGBA codestream and a gray-plus-alpha logo kept their transparency as RGBA and LA PNGs.
A 768×512 colour-mapped conformance file stayed a palette PNG of 222,402 bytes.
The display resolution stored in the JP2 header (72 dpi in the relax.jp2 sample) was written to the PNG's pHYs chunk.
Lossless PNG is big and slow for large images: the 4096×4096 solar image gave 5,198,403 bytes in 16 to 24 s, the 2717×3701 balloon print 13,126,488 bytes in 50 s.
A 67-megapixel scan did not finish within our conversion time limit as PNG, while JPG finished in 35 s. Use JPG, or resize with width, for scans that big.
If the JP2 was saved lossy, its wavelet blur and ringing are copied into the PNG exactly; PNG adds no loss of its own.
Embedded XML, including the FITS header in solar observatory files and rights statements in archive files, is not carried over.
We converted our JPEG 2000 sample (42 KB) with Image engine on 2026-10-20. It took 1.6 s and produced a 302 KB PNG file, 7.2× larger than the input. The engine raised 1 warning, listed below.
Input · sample.jp2 · 42 KB
43,179 bytes
Output · sample.png · 302 KB
480 × 600 px, 8-bit, colour type 2
A PNG of a page scan is still a picture of text. For searchable or editable text, run the PNG through the screenshot-to-text workflow, which uses AI Deep Read.
OpenJPEG
opj_decompress -i image.jp2 -o image.pngKeeps 16-bit samples, and -r 1 decodes at half size when you only need a preview.
Python (Pillow)
from PIL import Image
im = Image.open("scan.jp2")
im.reduce = 1 # optional: decode at half size, much faster
im.save("scan.png")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=png.
curl -X POST https://filetypeconverters.com/api/v1/convert \
-H "Authorization: Bearer $FTC_API_KEY" \
-F "file=@input.jp2" -F "from=jp2" -F "to=png" \
-F 'options={"width":0}' \
--output output.png| Key | Applies to | Type | Default |
|---|---|---|---|
| width | Writing PNG | number | 0 |
| height | Writing PNG | number | 0 |
| fit | Writing PNG | contain · cover · fill | contain |
| quality | Writing PNG | number | 90 |
| background | Writing PNG | string | #ffffff |
| stripMetadata | Writing PNG | boolean | true |
Yes for grayscale: our 16-bit test file came out as a 16-bit PNG with identical values. It is the route to use for medical, scientific and satellite images, which JPG would reduce to 8 bits.
JPEG 2000 files are usually saved lossy and compress far better than PNG's lossless deflate. The balloon print went from 628,654 bytes to 13,126,488 bytes as PNG.
Many sensors fill only the bottom of the 16-bit range; our sample used values up to 694 out of 65,535. The data is intact, and stretching levels in an image editor makes it visible.