Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering SciPy

You're reading from  Mastering SciPy

Product type Book
Published in Nov 2015
Publisher
ISBN-13 9781783984749
Pages 404 pages
Edition 1st Edition
Languages
Authors (2):
Francisco Javier Blanco-Silva Francisco Javier Blanco-Silva
Profile icon Francisco Javier Blanco-Silva
Francisco Javier B Silva Francisco Javier B Silva
View More author details

Image compression


The purpose of compression is the representation of images by methods that require less units of information (for example, bytes) than the mere storage of each pixel in arrays.

For instance, recall the binary image we constructed in the first section; that is a 128 x 128 image represented by 16,384 bits (True/False), where all but 113 of those bits are False. There surely must be more efficient ways to store this information in a way that require less than 16,384 bits. We could very well do so by simply providing the size of the canvas (two bytes), the location of the center of the disk (two more bytes), and the value of its radius (another byte). We now have a new representation using only 40 bits (assuming each byte consists of 8 bits). We refer to such exact representation as a lossless compression.

Another possible way to compress an image is the process of turning a color image into its black and white representation, for example. We performed this operation on the image...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}