Tuesday, October 9, 2018

Lossless and lossy compression

In information technology, lossy compression or irreversible compression is the class of data encoding methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size for storing, handling, and transmitting content.


Lossless and lossy compression are terms that describe whether or not, in the compression of a file, all original data can be recovered when the file is uncompressed. With lossless compression, every single bit of data that was originally in the file remains after the file is uncompressed.


Lossy file compression results in lost data and quality from the original version. Lossy compression is typically associated with image files, such as JPEGs, but can also be used for audio files, like MP3s or AAC files. The "lossyness" of an image file may show up as jagged edges or pixelated areas.



Here are some more examples of the lossy and lossless formats.

Images in GIF and JPEG formats are lossy, while PNG, BMP and Raw are lossless formats for images.
Audio files in OGG, MP4 and MP3 are lossy formats, while files in ALAC, FLAC and WAV are all lossless.

What are the advantages and disadvantages of lossy compression?

And we were still able to decrease our file size by 14%. So if you are looking to retain the quality of your images, lossless compression is definitely the way to go. Advantages: No loss of quality, slight decreases in image file sizes. Disadvantages: Larger files than if you were to use lossy compression

In information technology, lossy compression or irreversible compression is the class of data encoding methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size for storage, handling, and transmitting content.


  Lossless and lossy compression
Lossless and lossy compression are terms that describe whether or not, in the compression of a file, all original data can be recovered when the file is uncompressed
With lossless compression, every single bit of data that was originally in the file remains after the file is uncompressed.
Here are some  examples of the lossy formats.
1: This was a high quality JPEG image originally its file size was 77.9 kb after compressing the file it becomes a medium quality jpeg image of just 19.11 kb but if we zoom this image we cant see the picture clearly,some number of the original pixels are removed.
2:The JPG is on the left, and the GIF is on the right. The GIF file is 18 times the size of the JPG file, but the JPG still looks better but both the images are blurry. Images in GIFand JPEG formats are lossy
3 : Following is the gifs file . Its original size  705/591 mega pixels which is quite heavy.GIF achieves compression.it reduces the number of colors of color-rich images, thereby reducing the number of bits needed per pixel. 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.
:
4: ,here is another gifs file which was compressed and it replaced commonly occurring patterns, especially large areas of uniform color, with a short abbreviation.


5:JPEG formats are considered as  lossless but if we analyze the following image, the image on the right hand side is five time bigger than left hand side image. Though compression made this image bit blurry but still its quality is good its hard to tell the difference without zooming the image
.
6: JPEG image compression is Easier to See With Text.  The above image is with compressed and of 40k
and the bottom one is of 85 k with least compression. The compressed one is distorted and blury
7:  JPEG is a lossy, or compressed file format and lets each image be smaller than RAW files. When you convert a RAW file to a JPEG image due to compression on the image quality, you may see some fuzziness or color noise, which are called JPEG artifacts. Lower quality images have more artifacts, which is a result of the compression.

8:.Audio files in OGG, MP4 and MP3 are lossy formats,The file size is smaller but the original data is now gone forever. Some time the base or sound of certain music instruments are not audible in mp3 formats. Though its hard to tell without comparing both sounds or you need an ear to recognize such differences.


9: mp3 formats  use Perceptual music shaping ( the process of removing inaudible sounds in order to make a file size smaller.
Inaudible sounds may include:
  • Noises at frequencies that humans cannot hear
  • Quiet sounds that cannot be heard over louder sounds
10:mp3 formats compressed files also by reducing the audio bitrate.The bigger the bitrate, the better the sound quality, but the larger the file size. If you raise the volume of a mp3 song some distortion or vibration in sound is audible which is definitely not in raw file.
11: MPEG uses a type of lossy compression, since some data is removed. But the diminishment of data is generally imperceptible to the human eye.that can be seen in background of an image in form of partially blurred or mixed pixels


12::mp4 format reduces the level of detail in a pixel block (blending similar colours into one or smoothing out textures etc


13:Formats like H.264, MKV and WMV are lossy.H.264 has a smarter algorithm which can create small files that are still high quality but lost some minor sounds

HERE ARE SOME EXAMPLES OF LOSSLES COMPRESSION


1:FLAC  or Free Lossless Audio Codec, an audio format similar to MP3, but lossless, meaning that audio is compressed in FLAC without any loss in quality.sound quality is better than mp3 so it is an lossless compression
2:ZIP is an archive file format that supports lossless data compression. If you need to save data then zip files are best as they can compress and then restore the original form of the file
3:gifs are considered as lossless but as it was mention earliar gifs has a limit it doent work with more than 256 colors file it misses the same shades of colors while compressing
4:Apple Lossless: Also known as ALAC, Apple Lossless is similar to FLAC. It's a compressed lossless file, although it's made by Apple. Its compression isn't quite as efficient as FLAC, so your files may be a bit bigger, but it's fully supported by iTunes and iOS (while FLAC is not)
5:WAV is a file extension for an audio file format created by Microsoft. The WAV file has become a standard PC audio file format for everything from system and game sounds to CD-quality audio. Also referred to as pulse code modulation (PCM) or waveform audio, a WAV file is uncompressed audio.
6:The OGG Audio file format. OGG is a free, open container format created under unrestricted software patents by the Xiph.Org Foundation (Ogg Vorbis). It allows users to stream and alter high quality digital multimedia files thus this is lossless compression not easily detectable
7:A PNG file is an image file stored in the Portable Network Graphic (PNG) format. It contains a bitmap of indexed colors and uses lossless compression,for instance following image is mostly of blue color in order to compress majority pixels are changed to same blue shade.the change is unnoticeable without comparing with raw image but file size is reduced.
8:bmp is another image file. comparing with png  no difference in quality, both standards are lossless. BMP uncompressed takes more space, but when compressed (e.g. when put in a .zip or .7z file) BMP can be better ,If you are compressing photos.


9:Lossless PDF compression reorganizes your document’s data and stories it more effectively but never compromises the document’s vital information.


10:The ability to store image data in a lossless format makes a TIFF file a useful image archive, because, unlike standard JPEG files, a TIFF file using losslesscompression (or none) may be edited and re-saved without losing image quality. ... Other TIFF options are layers and pages.
That means that no data is being lost in the compression, unlike a lossy format like JPG. You can open and save a TIFF file as many times you like without degrading the image


No comments:

Post a Comment

Modi's policies and mass communication theories

Modi's policies and mass communication theories: *Modi's Policies:* 1. *Digital India*: Aims to transform India into a digitally emp...