JPEG vs TIFF

Van IsleVan Isle Registered Users Posts: 384 Major grins
edited March 16, 2007 in Finishing School
So I've searched 7 pages of "tiff" with no luck. wikipedia.org was no help either...

I just want to know why my .tiff images are 35 MB, but my high quality .jpeg images are 2 MB, of the same 6 MB RAW (NEF) image. Very curious...I figger it has to do with the appended colourspace??:dunno

Thanks much,

VI

:scratch
dgrin.com - making my best shots even better since 2006.

Comments

  • slapshotslapshot Registered Users Posts: 104 Major grins
    edited March 15, 2007
    Van Isle wrote:
    So I've searched 7 pages of "tiff" with no luck. wikipedia.org was no help either...

    I just want to know why my .tiff images are 35 MB, but my high quality .jpeg images are 2 MB, of the same 6 MB RAW (NEF) image. Very curious...I figger it has to do with the appended colourspace??ne_nau.gif

    Thanks much,

    VI

    headscratch.gif

    JPG is compressed, TIFF is not
  • Van IsleVan Isle Registered Users Posts: 384 Major grins
    edited March 15, 2007
    slapshot wrote:
    JPG is compressed, TIFF is not

    I got that part...but why is the RAW file 6MB, the (compressed) JPEG is 2MB (got that), but the uncompressed TIFF is 35MB, or ~6x LARGER than the original file? ne_nau.gif
    dgrin.com - making my best shots even better since 2006.
  • RichardRichard Administrators, Vanilla Admin Posts: 19,962 moderator
    edited March 15, 2007
    Van Isle wrote:
    I got that part...but why is the RAW file 6MB, the (compressed) JPEG is 2MB (got that), but the uncompressed TIFF is 35MB, or ~6x LARGER than the original file? ne_nau.gif

    RAW files may be compressed, hence smaller. Unlike JPG, the compression is lossless, meaning that using the proper software to read them, no image data is degraded. The compression scheme used in RAW files varies with the manufacturer.

    Does that make sense?
  • colourboxcolourbox Registered Users Posts: 2,095 Major grins
    edited March 15, 2007
    slapshot wrote:
    JPG is compressed, TIFF is not

    No, both can be compressed. Check your settings when you Save As in Photoshop. You can compress TIFFs using LZW, ZIP, etc.

    The difference, as someone else mentioned, is that TIFFs usually use lossless compression, which means zero quality loss. With JPEGs, you can crank the compression way up if you want, making the files very small, but to achieve that small size, much data and quality must be permanently thrown out of the file.

    Formally, TIFF is a file format while JPEG is more of a codec. That's why you can have a TIFF that is compressed by your choice of codecs, including JPEG.
  • SystemSystem Registered Users Posts: 8,186 moderator
    edited March 15, 2007
    I googled jpg vs. tiff and found this in less than 1 minute.


    The file types

    TIFF is, in principle, a very flexible format that can be lossless or lossy. The details of the image storage algorithm are included as part of the file. In practice, TIFF is used almost exclusively as a lossless image storage format that uses no compression at all. Most graphics programs that use TIFF do not compression. Consequently, file sizes are quite big. (Sometimes a lossless compression algorithm called LZW is used, but it is not universally supported.)


    PNG is also a lossless storage format. However, in contrast with common TIFF usage, it looks for patterns in the image that it can use to compress file size. The compression is exactly reversible, so the image is recovered exactly.


    GIF creates a table of up to 256 colors from a pool of 16 million. If the image has fewer than 256 colors, GIF can render the image exactly. When the image contains many colors, software that creates the GIF uses any of several algorithms to approximate the colors in the image with the limited palette of 256 colors available. Better algorithms search the image to find an optimum set of 256 colors. Sometimes GIF uses the nearest color to represent each pixel, and sometimes it uses "error diffusion" to adjust the color of nearby pixels to correct for the error in each pixel. GIF achieves compression in two ways. First, it reduces the number of colors of color-rich images, thereby reducing the number of bits needed per pixel, as just described. Second, it replaces commonly occurring patterns (especially large areas of uniform color) with a short abbreviation: instead of storing "white, white, white, white, white," it stores "5 white."
    Thus, GIF is "lossless" only for images with 256 colors or less. For a rich, true color image, GIF may "lose" 99.998% of the colors.


    JPG is optimized for photographs and similar continuous tone images that contain many, many colors. It can achieve astounding compression ratios even while maintaining very high image quality. GIF compression is unkind to such images. JPG works by analyzing images and discarding kinds of information that the eye is least likely to notice. It stores information as 24 bit color. Important: the degree of compression of JPG is adjustable. At moderate compression levels of photographic images, it is very difficult for the eye to discern any difference from the original, even at extreme magnification. Compression factors of more than 20 are often quite acceptable. Better graphics programs, such as Paint Shop Pro and Photoshop, allow you to view the image quality and file size as a function of compression level, so that you can conveniently choose the balance between quality and file size.


    RAW is an image output option available on some digital cameras. Though lossless, it is a factor of three of four smaller than TIFF files of the same image. The disadvantage is that there is a different RAW format for each manufacturer, and so you may have to use the manufacturer's software to view the images. (Some graphics applications can read some manufacturer's RAW formats.)


    BMP is an uncompressed proprietary format invented by Microsoft. There is really no reason to ever use this format.



    PSD, PSP, etc. , are proprietary formats used by graphics programs. Photoshop's files have the PSD extension, while Paint Shop Pro files use PSP. These are the preferred working formats as you edit images in the software, because only the proprietary formats retain all the editing power of the programs. These packages use layers, for example, to build complex images, and layer information may be lost in the nonproprietary formats such as TIFF and JPG. However, be sure to save your end result as a standard TIFF or JPG, or you may not be able to view it in a few years when your software has changed.


    Currently, GIF and JPG are the formats used for nearly all web images. PNG is supported by most of the latest generation browsers. TIFF is not widely supported by web browsers, and should be avoided for web use. PNG does everything GIF does, and better, so expect to see PNG replace GIF in the future. PNG will not replace JPG, since JPG is capable of much greater compression of photographic images, even when set for quite minimal loss of quality.
  • RichardRichard Administrators, Vanilla Admin Posts: 19,962 moderator
    edited March 15, 2007
    Another factor may be the bit depth. A TIFF may be using 16 bits per channel per pixel (48 bits/pixel) while the RAW image may only encode 12 per channel per pixel.

    In any event, I don't think there's anything weird going on. My Canon 20D generates RAW files that are around 8MB, but converting them to 16 bit (uncompressed) TIFF creates 48MB files--6 times larger.
  • colourboxcolourbox Registered Users Posts: 2,095 Major grins
    edited March 15, 2007
    rsinmadrid wrote:
    Another factor may be the bit depth. A TIFF may be using 16 bits per channel per pixel (48 bits/pixel) while the RAW image may only encode 12 per channel per pixel.

    Good catch. JPEGs are limited to 8 bits, while a TIFF can be more. (16, 32...)

    TIFFs can also include alpha channels, layers, etc. An uncompressed high-bit TIFF "with everything on it" is a huge file indeed.
  • wellmanwellman Registered Users Posts: 961 Major grins
    edited March 15, 2007
    Most people don't realize that RAW files are essentially greyscale. The sensor just records levels of light intensity. Your RAW converter knows that there's a Bayer filter over the sensor (of red-green-blue-green pattern), and uses that knowledge to construct the color image.

    So, an uncompressed TIFF will be 3x larger than an uncompressed raw. For each pixel, the RAW would have 256 levels of light intensity. The TIFF would have 256 levels of intensity for each of the R, G, and B channels at each pixel.

    Make sense? :D
  • wxwaxwxwax Registered Users Posts: 15,471 Major grins
    edited March 15, 2007
    wellman wrote:
    Most people don't realize that RAW files are essentially greyscale. The sensor just records levels of light intensity. Your RAW converter knows that there's a Bayer filter over the sensor (of red-green-blue-green pattern), and uses that knowledge to construct the color image.

    So, an uncompressed TIFF will be 3x larger than an uncompressed raw. For each pixel, the RAW would have 256 levels of light intensity. The TIFF would have 256 levels of intensity for each of the R, G, and B channels at each pixel.

    Make sense? :D
    Very intresting, thanks wellie.
    Sid.
    Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam
    http://www.mcneel.com/users/jb/foghorn/ill_shut_up.au
  • Van IsleVan Isle Registered Users Posts: 384 Major grins
    edited March 15, 2007
    Thanks Wellie and all,
    I got it now: TIFF(MB) = 3*RAW(MB) + details of the image storage algorithm. WOW!

    Lesson: don't store TIFFs on the laptop.

    Thanks folks thumb.gif

    VIbowdown.gif
    dgrin.com - making my best shots even better since 2006.
  • CatOneCatOne Registered Users Posts: 957 Major grins
    edited March 15, 2007
    wellman wrote:
    Most people don't realize that RAW files are essentially greyscale. The sensor just records levels of light intensity. Your RAW converter knows that there's a Bayer filter over the sensor (of red-green-blue-green pattern), and uses that knowledge to construct the color image.

    So, an uncompressed TIFF will be 3x larger than an uncompressed raw. For each pixel, the RAW would have 256 levels of light intensity. The TIFF would have 256 levels of intensity for each of the R, G, and B channels at each pixel.

    Make sense? :D

    Well, close, except RAW files are typically 12 bits. So there would be 4096 levels of light intensity per pixel in the RAW file. For the TIFF it's 8 or 16 (or maybe 32).
  • wellmanwellman Registered Users Posts: 961 Major grins
    edited March 16, 2007
    CatOne wrote:
    Well, close, except RAW files are typically 12 bits. So there would be 4096 levels of light intensity per pixel in the RAW file. For the TIFF it's 8 or 16 (or maybe 32).

    Whoops - forgot about that. Thanks for the correction!
Sign In or Register to comment.