JPG compression - yet another question !

Discussion in 'Digital Photography' started by Topaz, Nov 17, 2008.

  1. Topaz

    Topaz Guest

    Is there information in a JPG file that I upload from my digital
    camera that says what degree of compression has been used to write
    it ?
    Perhaps in the EXIF data, but I cannot identify it.

    Thanks in advance.
    Topaz, Nov 17, 2008
    1. Advertisements

  2. Topaz

    Bert Hyman Guest


    Using IrfanView to look at the EXIF data in images from my Canon A60 and
    S3, I see a field called "CompressedBitsPerPixel", with a value of 3 for
    the A60 images and 5 for the S3 images.

    I always run the camera at its highest resolution, so I don't know how
    those numbers change with different settings.
    Bert Hyman, Nov 17, 2008
    1. Advertisements

  3. Topaz

    KentTR Guest

    Does IrfanView report the chroma sub-sampling? (I have it here, just too lazy
    load it up and check right now.)

    There used to be (or is) a small command-line (DOS) program that would analyze
    an image and tell you what YCbCr chroma sub-sampling (2,1,1 / 4,2,2 / 1,1,1
    etc.) was applied and at what compression level. Does anyone remember that
    program and what it was called? I doubt I could even find it on my hard-drives
    anymore, it's been so long ago. That little program would do exactly what you
    KentTR, Nov 17, 2008
  4. No, as there can be many different algorithms used to compress the data,
    and hence no single value to the "compression". You will find that
    different programs express it differently, with Paint Shop Pro (for
    example) using a percentage scale where low values like 5-15% imply good
    quality, large file size, images. However, Photoshop uses something like
    (I understand) a simple 1..12 scale, where 12 is best (least compression,
    largest file size).

    David J Taylor, Nov 17, 2008
  5. Topaz

    Bert Hyman Guest

    In KentTR
    I don't see any tag with a name like that; maybe my camera doesn't
    generate it?

    I'd think that IrfanView would simply dump out anything that was in the
    Bert Hyman, Nov 17, 2008
  6. Topaz

    me Guest

    You should be able to find some entry which documents your camera's
    JPG quality setting. However, I don't believe you will find info that
    is universal.
    me, Nov 17, 2008
  7. Topaz

    KentTR Guest

    No, this isn't something in an EXIF tag anywhere. I thought that maybe IrfanView
    was doing its own analysis and reporting that info. In order to determine the
    chroma sub-sampling used, the old DOS program I mentioned had to go through and
    analyze the image itself. Trying to determine sampling area boundaries in the
    YCbCr colorspace. The author even claimed it couldn't do it with 100% accuracy,
    but it gave you a pretty good idea of what the original programming did to the

    Trying to reconstruct the original JPG compression that was used would be a bit
    like trying to reconstruct RAW image data from the interpolated view of it. You
    can guess, and guess real good, but it can't be done with any high-degree of
    accuracy. :)

    That's why that little program was kind of interesting. It did something that
    most all others couldn't do. Dedicated just to that task. I used it a few times
    in the distant past, more as a curiosity to see what compression levels my
    earlier cameras were using for their JPG output. (Which were pretty harsh
    compression levels in early cameras.)

    Now, if I could just remember the name of it ....
    KentTR, Nov 17, 2008
  8. Topaz

    Mike Mills Guest

    Check your camera settings.
    check the filesize, then resave as a lossless format.
    resave the lossless format as jpg.
    check the difference in size.

    Finally.. did it make any *visible* difference?
    open 2 windows and compare or swap windows with 2 versions.
    Mike Mills, Nov 17, 2008
  9. Topaz

    ben-taklin Guest

    Or, you could use Photoline as your editor. It has a built-in system found in no
    other editing program. It retains the original image in memory, compares that
    against your edits, and then resaves the new one with zero change in compression
    level, the only data changed in the saved image is that which you purposely
    changed. If you change the whole image then the same compression level as the
    original is used.

    It's the only truly lossless JPG editor I've ever found. It even handles
    lossless rotations better. All other editors must crop the image to JPG
    sub-sampling pixel boundaries as it performs their "revolutionary!" lossless
    rotation. If you try to rotate, for an easy to understand example, a 15x13 icon
    for some software you are writing. When rotated "losslessly" in all other
    programs it will truncate that to an 8x8 image. Well, there goes all those tiny
    but important pixels that you needed to convey your message on the toolbar.
    Ooops. In lossless rotations Photoline again checks against the original and
    then replace those border pixels from the original. Rotate a 15x13 image and you
    get back a 13x15 image.
    ben-taklin, Nov 17, 2008
  10. Topaz

    Bert Hyman Guest

    In "HEMI-Powered"
    With IrfanView 4.20, select Image->Information. At the bottom left of
    the popup should be a button labeled "EXIF info".
    Bert Hyman, Nov 17, 2008
  11. Topaz

    KentTR Guest

    I just ran this one that I found when trying to retrace my "online" memory:

    It might be the one I recall using, the output looks a little familiar, but
    don't quote me on it. Yeah, the more I look at the output, the more I think this
    is the one. The last line has a "quality" estimation too.

    Open a command-prompt window and just type ja filename.jpg

    The program and images have to be in the same folder (if you don't want to type
    long filename paths).

    Example output:

    I:\Downloads 03\JPEG Analyzer - ja001>ja waves.jpg

    JPEG Analyzer v.0.01 (Win32) FREEWARE
    Written by Dmitry Gorshkov
    Copyright (c) 2003-2004 All Rights Reserved.

    Scanning...: waves.jpg
    FFD8 at 00000000 SOI (Segment Of Image)
    FFE0 at 00000002 APP0 (JPEG Identification) Type: JFIF
    Type: JFIF - standard JPEG marker
    FFDB at 00000014 DQT (Definition Of Quantization Table)
    FFDB at 00000059 DQT (Definition Of Quantization Table)
    FFC2 at 0000009E *SOF2 (UNSUPPORTED) (Adobe PhotoShop)
    SOF2 Info: X: 2816, Y: 2112, Mode: Color (24 bits)
    FFC4 at 000000B1 DHT (Descriptor Of Huffman Table)
    FFC4 at 000000D1 DHT (Descriptor Of Huffman Table)
    FFDA at 000000EF SOS (Segment Of Scanning)
    FFC4 at 0003020A DHT (Descriptor Of Huffman Table)
    FFDA at 0003023E SOS (Segment Of Scanning)
    FFC4 at 00067D53 DHT (Descriptor Of Huffman Table)
    FFDA at 00067D8B SOS (Segment Of Scanning)
    FFC4 at 000884D6 DHT (Descriptor Of Huffman Table)
    FFDA at 00088513 SOS (Segment Of Scanning)
    FFC4 at 000B1591 DHT (Descriptor Of Huffman Table)
    FFDA at 000B15E8 SOS (Segment Of Scanning)
    FFC4 at 000FFA8B DHT (Descriptor Of Huffman Table)
    FFDA at 000FFAB4 SOS (Segment Of Scanning)
    FFDA at 00170D50 SOS (Segment Of Scanning)
    FFC4 at 001795F1 DHT (Descriptor Of Huffman Table)
    FFDA at 0017961A SOS (Segment Of Scanning)
    FFC4 at 001A2525 DHT (Descriptor Of Huffman Table)
    FFDA at 001A254F SOS (Segment Of Scanning)
    FFC4 at 001D05FC DHT (Descriptor Of Huffman Table)
    FFDA at 001D0624 SOS (Segment Of Scanning)
    FFD9 at 00273D60 EOI (End Of Image)
    Maked by: Independent JPEG Group's library (Quality=96) (color or b&w)

    Progressive JPEG
    KentTR, Nov 17, 2008
  12. Topaz

    Paul Furman Guest

    The camera may or may not include a custom field, for example:
    Maker Note (Vendor): -
    Image Quality - FINE

    Paul Furman

    all google groups messages filtered due to spam
    Paul Furman, Nov 17, 2008
  13. Topaz

    me Guest

    Note that the EXIF feature is one of those added by the Irfanview
    Plugins which have to dl'd and installed separately from the program.
    me, Nov 17, 2008
  14. HEMI-Powered wrote:
    Yes, you are correct. PSP-10 also uses a pure number. I was wrong when I
    mentioned percentage. In another library I use when programming the
    values are 1..100, where 80 is pretty good, and 95 excellent. Again, pure
    number, and not a percentage (although with 100 being near-perfect, it's
    tempting to think in percentages!). IrfanView uses a 1..100 scale as

    I also use the PSP-10 optimiser (Export to JPEG) and agree it's most
    handy. I use it when sizing pictures for a Web site, where the content
    and fast download are more important than the last bit of quality.

    David J Taylor, Nov 17, 2008
  15. Topaz

    ben-taklin Guest

    Getting off-topic here...

    I agree about those 2 things about PSP. I still keep it installed just for their
    CA-removal tool for fringing/blooming sensor artifacts. I've found no other
    plugin or software that handles sensor-blooming as well. (Though it is not
    useful for lateral CA, the kind imparted by refraction of optics, where colors
    disperse more at the edges.) I have to admit though, the Hue/Saturation tool in
    Photoline can work equally well. But it does take some time to learn how to use
    it effectively. It allows you to select a very narrow range of colors,
    feathering that range, then desaturate and change its luminosity level to match
    original surrounding pixels. The same as PSP's tool. It's just not as simple to
    use as PSP's where you select the fringing colors all at once and hit "OK".

    It's DCNR tool is also very nice. There are many 3rd party ones now that do
    more, but not as simple and good at the same time. (or com, both work)

    It's about $80? USD after conversion.

    Do read the manual on this one. As much as I despise reading manuals this
    program requires that effort. It does so much in such a small package that this
    is not an editor for beginners, by any stretch of the imagination. Your previous
    experience with the other programs will help you. Here's another helpful link
    that will help you to find and convert what you already know into Photoline
    work-flow methods and tool-names.
    It's lossless in the same way that you can unzip a compressed ZIP or RAR file
    and get back every bit of the original contents.

    You might like to know that Photoline is one of the only few editors out there
    that supports the new HDPhoto format and has done so for almost a year now. This
    new image format is one of the very few things that Microsoft did right. It's
    designed to support 16-bit depth images and all MetaData info while using JPEG
    compression. Think of it basically as a 16-bit JPG.

    It'll eventually catch on as more programs support it.

    Use Photoline's really nice "Web Export" feature to compare different
    compression types against each other (and against the original) and instantly
    see file-sizes and image quality in zoomed-in views to decide which is best to
    use for each kind of image being saved.

    I for one can't live without that nice side-by-side-by-side image compression
    feature in any editor anymore.
    Yes, but in all other applications their "rotate losslessly" throws away those
    border-pixels to match the 8-pixel JPG compression-block boundaries.
    ben-taklin, Nov 17, 2008
  16. Topaz

    Bert Hyman Guest

    Ah! Didn't know that; I thought it was a native feature. I download and
    install the complete set of plugins each time I move up a version.
    Bert Hyman, Nov 17, 2008
  17. Topaz

    Bert Hyman Guest

    In "HEMI-Powered"
    Someone else just pointed out that the EXIF display is not a native
    feature, but is done by a plugin. Since I always install the complete
    set of plugins each time I move up a version, I never noticed.
    Bert Hyman, Nov 17, 2008
  18. HEMI-Powered wrote:

    JPEG 2000 includes an option for lossless operation, as does standard
    JPEG. It's not widely available in standard JPEG, though. And JPEG 2000
    isn't widely used, either.

    Personally, if I want lossless I use PNG.

    David J Taylor, Nov 17, 2008
  19. Topaz

    Marty Fremen Guest

    Compressed Bits Per Pixel. In Irfanview this is EXIF property $E37122.
    Typical value is 4 bits per pixel for a fine jpeg. This is only a nominal
    value I think, since of course the actual bits per pixel will depend on the
    Marty Fremen, Nov 17, 2008
  20. Topaz

    Marty Fremen Guest

    If it works in the same way as BetterJPEG then it keeps the original
    compressed JPEG data in memory and where a JPEG tile* has not been altered
    during the edit it simply writes that original JPEG data back. That is,
    instead of recompressing the whole picture it only recompresses the tiles
    that have been modified. So the unaltered parts are indeed saved
    losslessly. If you are only altering a small part of an image, e.g. adding
    a caption or removing redeye, this kind of editor is very useful.
    (Unfortunately in BetterJPEG's case its text tool stinks as is doesn't

    *JPEGs are made up of 8x8 or 16x16 pixel tiles.
    Marty Fremen, Nov 18, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.