IT Hardwares

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

How Does JPEG Work? A Very Rough Answer

    View: 
We will have a look on how JPEG works in the simplest settings. Forget about color images, let's stick to grey-scale images. What is such an image? It is actually a table with numbers, representing brightness of the corresponding points, which vary from 0 to 255. What do we have to do? We have to develop two processes: the first (encoding) will transform an image (table with numbers) to a sequence of 0s and 1s, which is JPEG file. And aim is that such a sequence is not too long, i.e., it represents our picture in a compressed way. The second (decoding) will take JPEG file, the sequence of 0s and 1s, and will recover an image from it. Decoding is an inverse of encoding, so we concentrate on encoding process.



The core of the algorithm operates with small blocks of the image of size 8*8 pixels. There are three main steps: DCT, quantization, Huffman encoding. Sounds as abracadabra, lets look behind this.

DCT - discrete cosine transform. This is a tricky way to transform our image to another "image" of the same size (8*8), with new "colors" being called DCT-coefficients. Such transformation in a way simplifies the picture. In the following sense: if you have that all initial colors are close to some fixed color, the transformed "image", i.e., DCT-coefficients will have many close to zero numbers among themselves. It is easier to encode many zeros and few non-zeros (just trust in this).

Quantization - replacing DCT-coefficients by "rounded" numbers. For example, you have a DCT-coefficient which can be a number from -1023 to 1023. This gives you 2047 possibilities, and generally requires 12 bits (0s and 1s) to be stored in computer memory. OK, but let's say: we don't need to know that number exactly, some close number would be enough. Then one picks how rough we want to go, say we want to be not farther then 5. Then we can round up to 10. I.e., if we have 437, replace it by 440, if we have -171, replace it by -170. This way we have less possibilities - only numbers -1020, -1010, ..., -10, 0, 10, 20, ..., 1020. There are 205 cases then (much less than 2047), and 8 bits are enough to represent such a number. That's the idea. So, on quantization step, DCT-coefficients are rounded. This is where we loose some information, i.e., we would not be able to recover original image from quantized DCT-coefficients. But still, they are close enough to the real DCT-coefficients, so that the inverse DCT transform will give an image pretty close to our original one.

Huffman encoding - a way to store what is obtained after quantization. (There is in fact a small preliminary stage between quantization and Huffman encoding, called RLE, but we omit it now.) The goal is to code something which is frequent by bit combinations which are short. Example: you need to code a sequence of 100 letters, written using only a,b,c,d,e,f,g,h, 8 letters. Straightforward approach: 8 possibilities, 3 bits for each possibility, a=000, b=001, c=010, d=011, e=100, f=101, g=110, h=111, then you can always encode 100 letters using 100*3 = 300 bits. In practice, it may happen that 'a' appears much more frequently than other letters in your sequence. Then it is reasonable to spend less than 3 bits for such a letter. Of course, then you may need more bits for a rare letter, but overall you may win. This is the idea behind Huffman encoding - code frequent letters with shorter bit combinations. "Letters" in JPEG Huffman encoding are not letters, but properly arranged quantized DCT-coefficients.

That's all the magic. Without details. In summary, the ideas of JPEG compression algorithms are: special transform of the image (DCT), rounding the resulting numbers (quantization of coefficients) and smart coding of the result (Huffman) spending less info for more frequent "letters".
More Articles from
Computer Hardware Guide Pg476
A Plus Certification Test
Free Online Certification Exams
How To Christmas Card
How To Find Network Ip
How To Format A Dvd Disc
How To Get Email List
How To Prevent Spam
How To Prevent Virus
How To Promote My Site
How To Promote Online
How To Value A Business For Sale
Lucent Partner Phone System
Report Spam To Google
Services Of The Internet
Stephen King Book Signing
Types Of Computer Crime
Windows Programs At Startup
How To Process Payments Electronically
How To Profit From Trafficswarm And Other Traffic Exchange Directories
How To Prevent Data Loss Situations
» More on
Computer Hardware Guide
  • Related Articles
  • Author
  • Most Popular
Andrew Spivak has sinced written about articles on various topics from Digital Photos, Computers and The Internet. . Andrew Spivak's top article generates over 12100 views. to your Favourites.
Cat And Dog Behavior
Always make sure you correct the wrong behavior with the right
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday IT Hardwares has 2 sub sections. Such as Computer Guide and Hardware. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors