Zip files

Discussion in 'OS X El Capitan (10.11)' started by dougphd, Jul 31, 2016.

  1. dougphd macrumors member

    Apr 28, 2016
    When Mac zips an image file is it lossy or lossless?
  2. Shirasaki macrumors 604


    May 16, 2015
    It just creates an archive for a file, no matter which type that file is.
    So it is lossless. Unzip, and you get the exact same file.
  3. dougphd thread starter macrumors member

    Apr 28, 2016
    Would you please explain the difference between an archive for a file and a video compression? Is your answer the same if the file is being zipped, by say, google for emailing.
  4. T'hain Esh Kelch macrumors 601

    T'hain Esh Kelch

    Aug 5, 2001
    ZIP is a specific compression protocol which is reversible. Video compression is not per se.
  5. Toutou macrumors 6502a


    Jan 6, 2015
    Prague, Czech Republic
    Zip compression needs to be lossless to be even usable. A computer program, compressed with a lossy algorithm, would never work again. A book wouldn't be readable anymore.

    The thing is - to perform lossy compression on a file, the computer needs to know and understand what it's compressing. The MP3 compression algorithm knows and understands it's working with sound and performs an analysis of the sound to determine which parts can be omitted without a percieved loss of quality. The same with JPEG. The algorithm knows it's working with an image and decides (it's a pretty complex thing) which parts can be made simpler and described in a simple way to save some space.

    The ZIP algorithm doesn't know anything about your file, it just sees a bunch of ones and zeroes, therefore it can't decide which parts are OK to rewrite without a percieved loss of "quality" of your file.
  6. dougphd thread starter macrumors member

    Apr 28, 2016
  7. fluamsler macrumors member


    Mar 5, 2016
    near Basel, Switzerland
    You can imagine it a bit like that. Your File is saved binary on your storage. Let's say you have a small text document on your hard disk. The Binary code is: 00000111 11100011
    So the compression program reads the file and writes the information like this: 5x0 6x1 3x0 2x1

    Your file takes less storage but it is still complete available and the compression program knows exactly what's inside the container.
    After unzipping your file it makes the math the other way: 5x0 --> 00000 6x1 --> 111111 3x0 --> 000 2x1 --> 11 = 00000111 11100011

    I hope this helps a bit to understand the technique. :)

Share This Page