4

I have a big high-resolution orthophoto image (6cm/pixel, 22gb). I need to convert it to a JPEG image. Using QGIS (Raster - Conversion - Translate (Covert Format)) or the same GDAL command in OSGeo4W shell gives me the same error

Input file size is 152068, 195130

0Warning 1: 4-band JPEGs will be interpreted on reading as in CMYK colorspace

ERROR 1: libjpeg: Maximum supported image dimension is 65500 pixels

I tried to deflate the quality of the image through gdal_warp and gdal_translate commands to 8-9 cm/pix (I can't go lower than that) and it reduced file sizes to 12-10GB. But even though I have the same Error. I can't convert the image through PhotoShop either because it just drops every time because of such big files. Is there another way to convert a big GeoTIFF file into a JPEG image without losing the quality of the initial data?

3
  • 4
    You can't do that because JPEG/JFIF supports a maximum image size of 65,535×65,535 pixels en.wikipedia.org/wiki/JPEG. But JPEG is a poor choice for big images anyway because for reading any data out of JPEG the whole file must be decompressed. Split the image to reasonably sized parts if you really need just JPEG format.
    – user30184
    Commented Nov 14, 2021 at 18:53
  • If you were ok with cutting/subdividing the original image, you could use python along with GDAL to output smaller GeoTIFF images with JPEG compression that are almost visually identical to the original.
    – cm1
    Commented Jan 19, 2023 at 20:19
  • Are you sure you need a JPEG file (.jpg/.jpeg) or would a GeoTIFF with JPEG compression inside suffice? Commented May 23, 2023 at 7:19

1 Answer 1

1

JPEG image cannot be larger than 4 gigapixels (65,535×65,535 pixels) because the file format does not support that https://en.wikipedia.org/wiki/JPEG. You must split the image into smaller pieces.

2
  • Gigapixels != Gigabytes/Gibibytes. The limiting factor is the resolution not the file size. Commented May 23, 2023 at 7:18
  • 1
    Right, I corrected the unit.
    – user30184
    Commented May 23, 2023 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.