JPG Compression Question?

   / JPG Compression Question? #1  

BIGUN

Gold Member
Joined
Jul 13, 2003
Messages
442
Location
Tulsa, Oklahoma
Tractor
Kubota BX1500
This may not be the correct terminology, but do all the photo editing programs use the same compression engine to save pictures as a JPG? I have noticed that some programs seem to reduce the size of the picture file more while better preserving the quality. I know they all have provisions for selecting compression verses quality but some seem to do a better job of both at the same time. I know they all have to be compatible for the results to be universally viewable by everyone, but are there any differences in how they work?

Is this the case or is my imagination working overtime? /forums/images/graemlins/confused.gif
 
   / JPG Compression Question? #2  
Assuming that it is a good picture to begin with, the quality of the picture is determined by the resolution of the file, which is the number of pixels (or dots) per inch. For web viewing the resolution of 70 or so DPI seems to provide an acceptable image to me. For printing one would need much higher resolution. It seems that most people using imaging software try to use the "resize image" option to reduce file size. Reducing the dimensions of the image will generally reduce file size but also often make the image difficult to view. Most software also offers an option to change the resolution of the file and keep the dimensions at the original size. It may be necessary to reduce dimensions in order to obtain the file size desired, but not to the point that the picture isn't large enough to properly view.
 
   / JPG Compression Question? #3  
That's a good question. Fundamentally I believe that one way or another most compression software technology works by the software 'noticing' patterns (like the next x bits are all pure black...) and replacing the discrete bits with a 'formula' that will be read by the decompression (rendering) software at the viewing end (please insert 'y' copies of pattern 'x' here...). The resulting encoded file must as you said be readily decipherable by all software capable of reading that file type (i.e. jpg) but I don't see why one package may not be better at 'noticing' the patterns or finessing the compression effort. Subjectively I think I've seen a different quality of result from different software, but I've never studied the actual jpg 'rules' to tell if what you're asking is indeed possible.

One thing to be aware of, I believe a lot of software goes through the compression step each time you save the file. And each time you compress and de-compress you're probably losing details. So if you want to do a lot of changes to an image and save as you go to not lose your work - switch to a non-compressed zero-loss file type (like a tiff) until you're done. Then turn that image into a jpg at the compression you need only at the end, and only once.
 
   / JPG Compression Question? #4  
This is gonna get me some heat.... /forums/images/graemlins/crazy.gif

DPI has nothing to do with the size of the image file as it is stored on disk. DPI is a setting that is only used when outputting the image data to a physical medium such as monitor or printer. The horizontal and vertical pixel resolution of the image data are divided by the DPI of the physical device, which then gives you the actual linear dimensions of the outputted image.

There are three and only three factors that determine the size of the image file as it is stored on the disk.

<ul type="square"> [*]Raw pixel count (H x W) - 640 x 480 = 307,200 pixels [*]Color depth - 8 bits per pixel, 24 bits per pixel and 32 bits per pixel are common (8 bbp is grey scale, 24 bbp is RGB color, 32 bbp is RGB + Alpha blending) [*]Compression algorithm (JPG, PNG, etc) [/list]

For example......

An uncompressed image with horizontal resolution of 640 pixels and a vertical resolution of 480 pixels and a color depth of 24 bits per pixel is going to be exactly 921,600 bytes, plus a little for image header information if present. That 900Kb file is then reduced by applying a compression algorithm such as JPEG, PNG or JPEG 2000. The algorithm then uses various "magic" to reduce the file size. Most compression algorithms have a setting for the quality of compression to be used. JPEG uses a scale of 0% - 100% quality, with 0% being extremely high compression (really poor visible image quality, but tiny file size) and 100% being low compression (excellent visible image quality, but large file size).

The only way to reduce the file soze of an image is to reduce the horizontal and vertical resolution, increase the compression ratio, or both.

Dave

Other References:

Say NO to 72dpi!
Image size and Resolution
 
   / JPG Compression Question?
  • Thread Starter
#5  
Dave

I believe Glenn9643 is referring to the DPI resolution he is setting his scanner to, which will have a great effect on the size of the file.

Maybe I should have asked, do all photo editing programs use the same algorithm for JPG compression and is there anything else in each individual photo editing program that will affect the size or quality of the picture assuming both have their compression scales set to, say 80%.
 
   / JPG Compression Question? #6  
</font><font color="blue" class="small">( This is gonna get me some heat....
)</font>

No heat from here.... /forums/images/graemlins/smile.gif

You did a darn nice job of explaining it in a clear and concise manner. I believe some programs internal algorithms may be more efficient than others, but the output relies on the same output file structure.

You can take a super compressed 640 x 480 JPEG image and save it as a bitmap (.bmp). It will be the exact same size as any other 640 x 480 .bmp image of similar pixel depth whether the original image was compressed or not.

It's the McDonald's rule: "Parts is parts."
 
   / JPG Compression Question? #7  
<font color="blue"> The only way to reduce the file soze of an image is to reduce the horizontal and vertical resolution, increase the compression ratio, or both. </font>

Good description. You can also reduce the pixel depth in some programs (i.e. indexed color).

JPG is a licensed technology from the Joint Photographics Experts Group (JPEG), although vendors can implement various controls... thus an 80% in one program may not equal 80% in another. JPG looks for similarities within a range of pixels and throws out what it determines as unnecessary data, thus it is called a "lossy" compression.

Pictures without a lot of detail (lots of sky) will compress more than "busy" landscapes, etc.

It is best to keep an uncompressed original if possible. Recompressing a resized or cropped image can degrade quality quickly.
 
   / JPG Compression Question? #8  
No heat here either!
Your references state that the average monitor resolution is 72dpi which indicates that higher resolution within the file is unnecessary for web viewing generally.
I’m not an expert in this area and agree that “parts is parts”, but it is my understanding that by reducing the resolution of the image file you are reducing the “parts”. As long as you don’t degrade the number of parts below a certain number for web viewing the reduction in quality is negligible.
The point that I was trying to make is that most software also offers an option to change the resolution of the file and keep the dimensions at the original size. This reduction of resolution reduces file size. It may be necessary to reduce dimensions in order to obtain the file size desired, but not to the point that the picture isn't large enough to properly view.
Thanks for your explanation.
 
   / JPG Compression Question?
  • Thread Starter
#9  
The following is my conclusion on our discussion and not meant to say who is right or wrong only what is right. So no heat for me either please, just trying to learn something and share it. /forums/images/graemlins/smile.gif

Dave & Glenn9643, I looked in IrfanView and it does have a place to change the DPI setting. I experimented with changing it from 20 to 300 DPI, and like was stated in one of Dave’s links, I see no reason for it to even be there, because nothing about the image changes other than that number. Glenn, from my experiment I think if you were referring to changing the DPI in a program (not a scanner), any reduction in the size of a file must have been from inadvertently changing one of these:

--Raw pixel count (H x W) - 640 x 480 = 307,200 pixels
--Color depth - 8 bits per pixel, 24 bits per pixel and 32 bits per pixel are common (8 bbp is grey scale, 24 bbp is RGB color, 32 bbp is RGB + Alpha blending)
--Compression algorithm (JPG, PNG, etc)

“DPI is a setting that is only used when outputting the image data to a physical medium such as monitor or printer.”

Dave, I would only add, “or inputting from a physical medium (scanner)” to this statement.
 
   / JPG Compression Question? #10  
</font><font color="blue" class="small">( Dave, I would only add, “or inputting from a physical medium (scanner)” to this statement.)</font>

Absolutely true, the DPI is very important when scanning the image.

Dave
 

Tractor & Equipment Auctions

2015 VOLVO VNL TANDEM AXLE DAY CAB (A54607)
2015 VOLVO VNL...
FORD COBRA REPLICA RACING CAR (A53426)
FORD COBRA REPLICA...
2018 Ford F-250 Reading Enclosed Service Truck (A53422)
2018 Ford F-250...
2014 RAM 2500 (INOPERABLE) (A53843)
2014 RAM 2500...
2008 CATERPILLAR 725 OFF ROAD WATER TRUCK (A51406)
2008 CATERPILLAR...
Crosley 10ft Hydraulic T/A Dump Trailer (A50323)
Crosley 10ft...
 
Top