You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#113301 Resample images to 96 PPI?

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Wednesday, 22 March 2023 11:34 GMT

Buldre
As we know, JCE Editor provides the option to resample the image resolution to 72 DPI when resizing and editing. This, while many other image compression tools on the Internet, perhaps most of them, set the resolution to 96 PPI.

Is it possible to change the default resolution in JCE from 72 to 96, and if so, how? Maybe something that can be included in the next version?

And finally, I think that what we actually talking about, and what JCE is changing, is PPI, not DPI… At least that's what I'm talking about.

Ryan
DPI - whether 72 or 96 - is irrelevant when it comes to the display of web images, and only applies to physical printing of the images. Resampling an image in this way does not alter its physical dimensions, and for the most part appears to increase the size of the image. I am debating whether to keep the option in.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Buldre
Thanks for reply. Yes I know, this only matters when printing the pictures, which doesn't happen very often these days, but it does happen from time to time. My idea was to have a standard resolution for images, so that 3 images of the same size in an article not come out with very different sizes on a printout.

Meanwhile, I've realized that my first question didn't reflect what I wanted to achieve, which was simply to set the resolution to 96 without changing the number of pixels for the image. A resampling is not required to change resolution, and changing resolution should not change the file size. Reference: “However, the PPI has no impact on the file size”:
https://nickkidd.net/blog/2020/7/21/72-ppi-is-a-myth

So if JCE removes the resampling option, maybe you could replace it with an option to just change the resolution without resampling?

The JCE option with resampling to 72 DPI seems to have a strange effect on file size. I uploaded an image of 4000 x 2667 pixels, resolution 300 PPI, and file size 2.04 MB, and then I end up with an image of 4000 x 2667 pixels, resolution 72 PPI, and file size 4.79 MB. Why is the file size changed when the number of pixels is the same as before, well not just changed but actually more than doubled?

Ryan
The JCE option with resampling to 72 DPI seems to have a strange effect on file size. I uploaded an image of 4000 x 2667 pixels, resolution 300 PPI, and file size 2.04 MB, and then I end up with an image of 4000 x 2667 pixels, resolution 72 PPI, and file size 4.79 MB. Why is the file size changed when the number of pixels is the same as before, well not just changed but actually more than doubled?


This is due to the Upload Quality value, which when set to 100, will apply no compression to the image, so the size of the image will be based on the Number of Pixels x Number of Bytes per Pixel, eg: for a 4000 x 2667 image at 24Bit RGB this would be up to 32 MB - https://www.omnicalculator.com/other/image-file-size

You can see this in GIMP, Affinity Photo, macOS Photos etc. when exporting an image at 100% JPEQ Quality.

I've made a change in JCE Pro 2.9.35, to use the 100% Upload Quality and Resize Quality values as equivalent to "Not Set", ie: to not set an additional compression value. In PHP IMagick this works largely as expected, the image size remains close to the original. In PHP GD, this defaults to the system value of 75, which may affect the image size.

In both cases, using quality values of 80 or 90 will usually result in the image size being greater than the original. It seems that most images found on the web are compressed with values close to 70%.

I have also changed the Resample value to 96 in JCE Pro 2.9.35

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan
I asked ChatGPT to explain some concepts around image size and JPEG Compression, and the explanations are now listed in the FAQ:

https://www.joomlacontenteditor.net/support/faq/editor/how-is-an-images-byte-size-calculated

https://www.joomlacontenteditor.net/support/faq/editor/how-does-jpeg-compression-work

https://www.joomlacontenteditor.net/support/faq/editor/why-does-100-jpeg-compression-result-in-a-smaller-file-size-than-the-full-pixel-size-of-the-image

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.