Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Improve quality JPG
#7
(05-04-2021, 04:19 PM)programmer_ceds Wrote:
(05-04-2021, 03:51 PM)quand Wrote: okay, very well, please excuse my question which is that of the beginner that I am; in any case, I thank you.

Is it possible with Gimp to know at what level of compression a jpeg image taken from the internet has been saved?

thank you 

No problem with asking the question.

I think that determining the compression level used when the image was saved by inspecting the image would be a very imprecise thing to do - the compression level isn't saved in the file for instance. Perhaps some qualitative estimate based on the variation in colours - but not really of much use.

Gimp knows... The first line at the top of the JPG export dialog is the option Use quality settings from the original image!!!

Also, there are two things in JPEG that make the image take less space:

  1. The "Chroma subsampling". The takes advantage that our eyes are not as good on color than on brightness(*). So instead of being stored as three R+G+B images, the image is stored as a Luminosity/brightness channel (more or less the B&W version of the image), and two "chroma" channels. Instead of storing the two chroma images at the same definition as the Luma image, the JPEG file can store them as and image which is scaled to half in one dimension or to half in two dimensions. So in an image with P pixels, instead of storing 3×P values, you store P+.5×P+.5×P=2×P (chroma halved) or P+.25×P+.25×P=1.5×P (chroma quartered). In this case we have divided the amount of data by two (1.5×P instead of 3×P) without even doing compression. The JPEG from my DSLR are at quality 97 but with halved chroma, so the engineers at Canon have likely checked that most people won't notice.  
  2. Then we have the compression of the data in each channel, using the "quality". In some apps you can only specify a "quality" but they link the subsampling to quality ranges. In othe rapps such as Gimp you can specify both. So when we talk about the "same quality", does it include the subsampling? The compression is lossy but the algorithm is "stable". If you decompress and recompress with the same settings, the data settles rather quickly on values that won't change. So, strangely, you may lose more data by changing to a higher quality setting than by reusing the current ones. But this of course assumes that you are using the very same code each time, so if the image doesn't come from Gimp (on Linux, from any app that uses libjpeg) this is not true.
(*) Try this with a picture:
  • make a copy of the layer, and desaturate to luminance
  • make a second copy of the original layer drag it to the top
  • Layer>Scale layer and scale it to 25% (each side divided by 24)
  • Layer>Scale layer and scalte it back to its initial size. You should see something somewhat blurry.
  • Set you blurred layer to LCh color blend mode, thus adding its color to the monochrome version.
  • Compare with original
   
Reply


Messages In This Thread
Improve quality JPG - by quand - 05-04-2021, 02:55 PM
RE: Quality JPG - by programmer_ceds - 05-04-2021, 03:43 PM
RE: Quality JPG - by quand - 05-04-2021, 03:51 PM
RE: Quality JPG - by programmer_ceds - 05-04-2021, 04:19 PM
RE: Quality JPG - by quand - 05-04-2021, 04:35 PM
RE: Quality JPG - by Ofnuts - 05-04-2021, 05:35 PM
RE: Quality JPG - by programmer_ceds - 05-04-2021, 10:47 PM
RE: Quality JPG - by Ofnuts - 05-04-2021, 11:49 PM
RE: Improve quality JPG - by rich2005 - 05-04-2021, 05:11 PM
RE: Improve quality JPG - by quand - 05-04-2021, 06:11 PM
RE: Improve quality JPG - by quand - 05-06-2021, 11:29 AM

Forum Jump: