Short answer
You probably know that an image is represented on a computer as a matrix of colored
dots. And you also probably know that these dots are called "
pixels".
The "resolution" is a term that indicates the number of pixels in a matrix. For instance, 1024x768 resolution is similar to say "
a matrix with 1024 pixels length and 768 pixels width". That's a total of 786432 pixels (0.7 megapixels).
To understand the difference between 16-bit and 32-bit images, you can read about
color depth. In short, it's about how are pixels represented in "computer language": if each pixel is made of 16 bits, it's then called .. "16-bit". Same goes for 32-bits.
Longer answer
(
This one may be a bit more difficult to follow, but as usual, do not hesitate to ask questions if anything's unclear)
In order to solve an issue, specialist in any field usually start by
defining a "language" that describes the problem best. This is actually very common:
- Gamers will talk about "controllers" or "loading times" and these words won't have much sense for non-gamers.
- Musicians talk about "pitch", "reverb" or "delay" and it helps them solve their problems.
- ...
The problem you're dealing with is representing an image on a computer. Understanding the difference between "
32-bit images" and "
64-bit images" is really about understanding the language that digital image specialists have developed to describe their problems. I'll also take this opportunity to introduce you to the general way of building domain specific languages[1], while showing applications to our image problem.
How does one build a powerful language? Here are the essential components.
- A set of primitives
- Means of combination
- Means of abstraction
Let's explore what they are:
[1] Note that "domain specific language" is usually used in Computer Science and programming, whereas the term "domain specific modeling" seems more general and applicable to wider degrees of engineering. I will use both terms interchangeably.
Primitives
Primitives are the smallest, indivisible elements of our language. In the case of our images, we will build our language on top of the "computer language" we talked about in my first answer. This means we have two things to manipulate:
Another way to define your primitives, is to say you have to build a language using a 2-element alphabet: {"bits", "bytes"}.
Means of combination
A language should give you the ability to combine elements in an interesting way and to manipulate combination of elements as well. We saw earlier two means of combinations used in different languages: punctuation in English combines letters into words, and defining a fixed size for the "computer language" combines bits into bytes.
Our "image language" will define its own combinations. Here's one:
the pixel.
A pixel is a single dot, the smallest dot that will be printed on the screen. It has a single color. When computers were slow and transferring files over the network (internet) was costly, we used a sequence of 16 bits to define the color of the pixel. How to translate a sequence of 16 bits into a color distinguishable by the human eye is a very complex subject that I will not get into right now. Suffice to say, each sequence identifies a single color uniquely. As computers grew faster and network transfer got cheaper (and screens got bigger and better, and so many other reasons), people felt limited by having "only" 16 bits to define their colors. They started using sequences of 32 bits to define their pixels.
So there you have it a 16-bit image uses 16 bits to represent each pixel. 32-bit images use 32.
Exercise 1: How many colors can be represented in a 2-bit image? 4-bit? 8-bit? 16-bit? 32-bit?
We just saw that we can create elements (like pixels) by combining our primitives together. However there's so much more we can do with it. Just like we can combine words together to create sentences, we can create combinations based on other combinations! We call these elements
compound elements[2]. By realizing that an image is nothing more than a rectangle made of a high number of tiny dots we can create our new combination: an
image is a series of pixels organized in a matrix.
This is the first time we come across a combination that imposes an organization different than the sequence. I chose to represent the images as a matrix of pixels. So not just any sequence will do. In real life, images will often use a different organization that would be more optimal but more complicated to understand. The thing I want you to realize now is that a combination can force an organization on its elements.
Exercise 2: When I convert an image from 16-bits to 32-bits, what happens to the size of the image?
[2] This Wikipedia article is difficult to read and focuses on the "classical" linguistic. It's good to skim through, but it's a bit far from what we're dealing with.
Means of abstraction
NB: It's not easy explaining what abstraction is. It's a complex subject and goes beyond the questions that you asked. I'll do my best to give you a small introduction to the concept, but it's far from being exhaustive.
Abstraction is what lets you use primitives in a language without caring for how they are implemented. For instance, we used bits in our image language, but we never knew if bits are implemented on an electronic board, mechanical tubes or quantum
qubits. It doesn't matter, and it won't change what we're doing.
Similarly, another language will use
images and
pixels as primitives. For instance, Adobe Photoshop or Mozilla Firefox don't know
how an image is created, how are the pixels created or how are they organized to form the image.
By separating definitions into levels of abstraction, you create systems that are changed more easily. When we will move to a new kind of computer (the common example is quantum computers instead of electronic ones), all we need to do is replace bits by qubits and our definition of
pixels and
images will remain correct.