moderated Question about image processing #misc


 

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


 

David -
Two possibilities come to mind. Do you have the image size limited to 1024 x 1024 or smaller? Can you convert them to JPG files instead of PNGs?
 
I suspect the system was designed around common JPGs, and PNGs might be confusing it. If you're using a different palette, that palette may need to be included with the file. You might experiment with that possibility.
 
I've used one of several draw programs for image compression, but I've found that in many cases Irfanview does a credible job quickly.
 
Dano
_____________________
 
David Bryant <david@...> writes:

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


 

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


 

On 2021-10-26 15:02, Christos Psarras via groups.io wrote:
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.
To clarify, this happens during online posting on embedded PNG images which are bigger than 640 pixels and need to be scaled down.  If 640 or less they stay the same colorspace.

Cheers,
Christos


 

On Tue, Oct 26, 2021 at 11:22 AM, D R Stinson wrote:
David -
Two possibilities come to mind. Do you have the image size limited to 1024 x 1024 or smaller? Can you convert them to JPG files instead of PNGs?
 
I suspect the system was designed around common JPGs, and PNGs might be confusing it. If you're using a different palette, that palette may need to be included with the file. You might experiment with that possibility.
 
I've used one of several draw programs for image compression, but I've found that in many cases Irfanview does a credible job quickly.
Most of the images I use are screenshots. So the only "limit" on image size is my monitor, which is 1920 x 1080 (often "dumbed down" to 1600 x 900 -- I'm old, and my eyesight is failing). I usually take a shot of just a portion of the screen, so my images are rarely any larger than 1024 x 1024.

I played around with GIMP, the GNU Image Manipulation Program (https://www.gimp.org/). In general, converting a .png file to .jpg format increases the file size by some 100% to 150%. That's for screenshots. If I were processing photographs, .jpg would most likely be the better choice, in terms of file size. But screen shots of web sites usually contain a lot of straight lines and sharp corners, which are more compactly encoded by the .png algorithm. Oh, yeah. JPG files have been around since 1992. But PNG came along in 1997, and software support for the newer format is fairly ubiquitous. I'm sure Mark uses programs that support a great number of file forrmats. For instance, the aforementioned GIMP (free software) supports 40 different file formats, from als to xwd.
 
--
David Bryant
Canyon Lake, Texas
https://t-vog.groups.io/g/main    https://davidcbryant.net


 

On Tue, Oct 26, 2021 at 02:02 PM, Christos Psarras wrote:

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. [big snip ...]

I composed the message at the web site. I'll experiment with emailing images instead, sometime. I don't often do that because of minor incompatibilities between the HTML generated by KMail, my email client, and the HTML processor at the web site. These incompatibilities often cause rendering problems in the broadcast message. So I usually use the web site to compose new messages.

Thanks for the information about jpeg compression. That's interesting.
 
--
David Bryant
Canyon Lake, Texas
https://t-vog.groups.io/g/main    https://davidcbryant.net


 

On Tue, Oct 26, 2021 at 11:22 AM, D R Stinson wrote:
David -
[snip]. If you're using a different palette, that palette may need to be included with the file. You might experiment with that possibility.
 

 Oh, yeah. I forgot to mention this. In a .png file, the palette is actually embedded in the file itself. It (the palette) is optional, and can accommodate up to 48-bit color encoding. I don't think there are any graphics cards around that support color depths beyond 30 bits. The extra  bits (software only) are used to minimize rounding errors in interpolation / smoothing algorithms that use floating point arithmetic, I think.
--
David Bryant
Canyon Lake, Texas
https://t-vog.groups.io/g/main    https://davidcbryant.net