Page 1 of 1
Max Resolution of JPEG
Posted: Mon Mar 15, 2021 1:59 am
by brazenvoid
So I am cutting comic strips nowadays and have encountered this issue. As far as I know JPEG is limited to 4 Gigapixels max resolution for an image but Xnview instead limits the y dimension at ~65,535, even though the x is less than 1000.
Is this really how JPEG is?
Also, please consider adding an error message and not saving the file. Right now, it saves a 0 byte file and keeps association with it, meaning it closes the tab, if I delete the said file from explorer. As that tab contains a generated (joined) image from many files, it is really not desirable to lose it.
Re: Max Resolution of JPEG
Posted: Mon Mar 15, 2021 8:51 pm
by cday
brazenvoid wrote: Mon Mar 15, 2021 1:59 am
As far as I know JPEG is limited to 4 Gigapixels max resolution for an image but XnView instead limits the y dimension at 65,535, even though the x is less than 1000.
Is this really how JPEG is?
The maximum JPEG image size is defined in terms of the maximum image dimensions of 65,535×65,535 pixels, rather than the corresponding maximum number of pixels of 4 gigapixels for an image with an aspect ratio of 1:1,
Wikipedia - JPEG.
Please consider adding an error message when trying to save an image with a dimension greater than 65,535 pixels and not saving the file. Right now, it saves a 0 byte file and keeps association with it, meaning it closes the tab, if I delete the said file from explorer. As that tab contains a generated (joined) image from many files, it is really not desirable to lose it.
Pierre?
Re: Max Resolution of JPEG
Posted: Tue Mar 16, 2021 5:58 pm
by brazenvoid
cday wrote: Mon Mar 15, 2021 8:51 pm
brazenvoid wrote: Mon Mar 15, 2021 1:59 am
As far as I know JPEG is limited to 4 Gigapixels max resolution for an image but XnView instead limits the y dimension at 65,535, even though the x is less than 1000.
Is this really how JPEG is?
The maximum JPEG image size is defined in terms of the maximum image dimensions of 65,535×65,535 pixels, rather than the corresponding maximum number of pixels of 4 gigapixels for an image with an aspect ratio of 1:1,
Wikipedia - JPEG.
It specifies that for only aspect ratio being 1:1. Meaning it is not that resolution for different aspect ratios. I have not been able to dig up a formula or a range of possibilities in that regard yet.
Re: Max Resolution of JPEG
Posted: Tue Mar 16, 2021 6:06 pm
by cday
brazenvoid wrote: Tue Mar 16, 2021 5:58 pm
cday wrote: Mon Mar 15, 2021 8:51 pm
brazenvoid wrote: Mon Mar 15, 2021 1:59 am
As far as I know JPEG is limited to 4 Gigapixels max resolution for an image but XnView instead limits the y dimension at 65,535, even though the x is less than 1000.
Is this really how JPEG is?
The maximum JPEG image size is defined in terms of the maximum image dimensions of 65,535×65,535 pixels, rather than the corresponding maximum number of pixels of 4 gigapixels for an image with an aspect ratio of 1:1,
Wikipedia - JPEG.
It specifies that for only aspect ratio being 1:1. Meaning it is not that resolution for different aspect ratios. I have not been able to dig up a formula or a range of possibilities in that regard yet.
Quote from the above Wikipedia link:
JPEG/JFIF supports a maximum image size of 65,535×65,535 pixels, hence up to 4 gigapixels for an aspect ratio of 1:1.
I read that as limiting the maximum height and/or width pixel dimensions to 65,535...
Re: Max Resolution of JPEG
Posted: Tue Mar 16, 2021 6:07 pm
by brazenvoid
I see it now, the two dimensions are recorded in 2x 2-byte unsigned integers. Aspect ratio doesn't matter, I don't know why the Wikipedia article even cared to make the relation.
Re: Max Resolution of JPEG
Posted: Tue Mar 16, 2021 6:17 pm
by cday
brazenvoid wrote: Mon Mar 15, 2021 1:59 am
Please consider adding an error message when trying to save an image with a dimension greater than 65,535 pixels and not saving the file. Right now, it saves a 0 byte file and keeps association with it, meaning it closes the tab, if I delete the said file from explorer. As that tab contains a generated (joined) image from many files, it is really not desirable to lose it.
@Pierre:
Although creating an image with a pixel dimension greater than 65,535 would be unusual, it would be easy to display a warning if someone tries to save an image as a JPEG when one of the pixel dimensions is greater than that value, rather than as now produce a file that isn't valid?