moderated Re: Question about image processing #misc


 

David,

I'm not sure if you embedded those PNGs in your message through email or online, but it seems emailed 256-color/8-bit embeds retain their colorspace encoding but online embeds get upscaled to 16 million colors / 24-bit, so for online embedding that doesn't seem right and it would increase file size.

But there's also the matter of image compression value when saved to the cloud.  From trial & error, for jpegs at least, it seems 20%-25% is the compression factor used when images get saved on the cloud.  If you send in a jpeg or possibly other compressible formats as well, saved with anything above that, the returned image in the message comes back bigger in file size. (for the same dimensions)

Not to hijack the thread but the interesting thing though, to me at least, is not embedded images but attached images in messages.  Even those get compressed at that cloud compression value so one gets back attached jpegs which are not the same ones as sent in.  (this is for jpegs at least, uncompressed images such as BMPs do come back the same)  For example, an attached 1959x1306 jpeg saved with 5% compression, 1,332kb, comes back with the same dimensions but only 629kb so it was compressed higher when stored on the cloud. I can see embedded images get changed/manipulated but I was under the impression attachments do not get messed with. This may be disconcerting to folks who count on image fidelity or archival quality in their attachments in their messages.  But I guess one should use Photos or Files for archival quality purposes as no image processing takes place in there.

Cheers,
Christos


On 2021-10-26 11:35, David Bryant via groups.io wrote:
Yesterday I posted a message to my group that included two .png image files. The files I uploaded from my hard disk had these characteristics.

Image #1: 1043 x 543 pixels, 51,102 bytes
Image #2: 1011 x 614 pixels, 34,600 bytes

In the archived version of the message on the groups.io web site I find these file statisics.

Image #1: 640 x 327 pixels, 124,301 bytes
Image #2: 640 x 381 pixels, 89,969 bytes
(these images are stored in the Amazon "cloud")

In terms of display area, groups.io shrank the first image by 63.05% and the second by 60.72%. (The two percentages are different because of different aspect ratios.) But the file sizes increased: by 143.24% and 160.03%. respectively.

So here's my question. Why does a lower resolution image take up so much more disk space?

I have a hunch that it relates to color encoding and the program Mark is using to rescale every image that's more than 640 pixels wide. I had gone to some trouble to compress the images using a 256-color palette and 8-bit color codes. I used an open source program called "pngquant" (https://pngquant.org/). I suspect that the program which rescaled the images desstroyed the color palette and reverted the images to 24-bit color codes. Assuming that's what happened, is there an easy way around it? For instance, what if I resized the images to be 640 pixels wide before uploading them to the groups.io servers? Would the image processing algorithm leave them alone? Or would they still get a whole lot bigger? Are the file sizes increased by groups.io software? Or is that a "feature" of the Amazon "cloud"?

I'll do some experimenting to find out (by sending a private message to myself, and not to the whole group). It's not a big deal, so far as I'm concerned. I'm far, far under the 20 GB "free images" threshold for a premium group. Still, for somebody with a lot of stored images. it might make a difference in the amount the group is charged for image storage. People might even appreciate it if image compression via pngquant were offered as an opion on the groups.io web site. Email messages with smaller (in bytes) images would download faster, etc. So I thought I should mention it here.
--
David Bryant
Canyon Lake, Texas
https://t-vog.groups.io/g/main    https://davidcbryant.net

Join main@beta.groups.io to automatically receive all group messages.