TechKnowSurge
CompTIA Tech+ 1.2 CompTIA Tech+ 1.5
VideoComputeFree

Compressing Graphics

Uncompressed image and video files consume enormous amounts of storage, making compression algorithms essential for practical use across digital media. This topic covers how pixel data accumulates into massive file sizes and introduces how compression techniques reduce that footprint.

Complete this video to capture a CTF flag worth 1 point.

About this video

Raw graphic and video files carry a significant storage cost rooted in how pixel data is encoded. Every pixel in a standard RGB image requires three bytes to store its color values, so file sizes scale quickly with resolution. A small sprite might stay under a kilobyte, but a high-resolution photograph measuring roughly 8,889 by 6,553 pixels produces around 159 megabytes of uncompressed data, and modern cameras regularly exceed even those dimensions. Video compounds the problem substantially. A single frame of 4K UHD footage at 3,840 by 2,160 pixels requires approximately 24 megabytes of raw storage. At 60 frames per second, one second of that footage reaches 1.4 gigabytes, one minute climbs to 89 gigabytes, and a 90-minute film accumulates roughly 8 terabytes of uncompressed data. These figures make compression not a convenience but a technical necessity for any real-world application. Compression algorithms reduce file size by eliminating redundant or unnecessary data while preserving acceptable visual quality. One foundational approach limits the number of bits used per pixel based on how many distinct colors actually appear in an image, replacing the standard three bytes per pixel with as few as two bits when only a small color set is present. Format-level compression such as PNG applies more sophisticated encoding to achieve similar goals, and the difference is measurable: the same image saved as an uncompressed bitmap and then re-saved as a PNG can drop from 630 bytes to 132 bytes, representing a reduction of nearly 80 percent without any visible loss of content.

What you'll learn

What's covered

Compressing Graphics

Aligned to

CompTIA Tech+
1.2 Compare and contrast fundamental data types and their characteristics.
1.5 Compare and contrast common units of measure.

Key terms

Pixel
The smallest addressable unit of a digital image, whose color is encoded as binary values representing red, green, and blue channel intensities; display resolution is expressed as a grid of pixels.
Bit Depth
The number of bits used to represent the color of a single pixel, which determines the total number of possible colors in a digital image.
Color Depth
The number of bits or bytes used to encode color information per pixel, determining how many distinct colors an image can display.
File Compression
The process of reducing the size of one or more files using software algorithms to save storage space and make file transfers faster.
Bitmap
An uncompressed image format that stores color data for every pixel individually, with file size directly determined by pixel dimensions and bit depth.
Portable Network Graphics
PNG
A compressed image file format that reduces storage size while preserving image quality by encoding pixel data more efficiently than bitmap formats.
Frame Rate
The number of individual images (frames) displayed per second in a video, commonly measured in frames per second (fps); higher frame rates increase storage requirements.

Topics

Image Compression File Formats Color Depth Pixel Data Digital Media Data Storage Graphics

Transcript

Graphics can get quite large, and so there is a need to compress graphics.

How much space an uncompressed image takes

In our Mario example, we have 12 pixels across the top and 16 across the side, and 12 times 16 is 192. Each one is represented by three bytes, so if we times this by three bytes we now get 576. That is not a ton of space here - 576 bytes is not concerning.

But imagine now if we have a much bigger picture. Let us use this example of this picture of wafers. This picture is 88,89 pixels wide and 6,553 pixels high, so in total we have 53 million pixels here. Now times that by three bytes and we have 159 million bytes, so that is 159 megabytes for this one picture. And this is not even - there are cameras that go even beyond this. So every time we took a picture we would be taking up 159 megabytes of information, which is a lot of information.

Movies are much bigger

Movies are even more, because they are showing you a series of pictures. Let us say it is a 4K movie. 4K UHD is 3,840 pixels across by 2,160 pixels, so we have got about 8 million pixels that we are working with, times three bytes per pixel to store that color. Now we have got 24 million bytes, 24 megabytes, that we are working with for every single picture.

A standard movie - a lot of movies nowadays are filmed at 60 frames per second. So at 60 frames per second we take a single frame times 60, and now every second we are having 1.4 billion bytes, so 1.4 gigabytes of information. We do that times 60 seconds in a minute, so we times it by 60, and now for every minute we are storing 89 billion bytes, so 89 gigabytes of information. You times that by a 90 minute film - which is not really a super long film by any means, it is kind of a short film actually - and now you have got 8 trillion bytes, so 8 terabytes of information just for this one movie. So you can see movies can take up a lot of space.

One way to compress an image

There are a lot of different ways we can compress files, and there are a lot of different algorithms out there to do those file compressions. I am going to show you one example here.

Let us say right here we have got four colors that we need to represent. Let us give them a number. We can say this blue is 0 0, this red right here is a 0 1, this green is a 1 0, and the yellow is a 1 1. Now we only have two bits that we have to store for this, because those are the only colors that we are using. So we could represent each pixel by two bits rather than three bytes of information. That can significantly decrease the size of this image right here.

That is just one way to compress. That is not the standard way that we compress graphics, but it is a way that we do compression on other data.

Bitmap versus PNG

What I am going to do is create a new picture here. I am just going to save it, and I am going to save it as a bitmap. The reason why I am saving it as a bitmap is because that is storing those three bytes per pixel, so it shows us the full size of this. I am just going to call it blank BMP, and I will hit save here.

Here is the file, and I am going to right click on this and say properties, and this is 630 bytes. No surprise there, because that is the same as our Mario from another lesson. So 630 bytes is the size of this that we are saving here.

Now what I am going to do is save this as a PNG. PNG has some compression to it. I will save it here, and instead of blank BMP we will call this PNG. Now let us take a look at the size of this. I am going to right click on this, properties, and we see it is now 132 bytes, so significantly less.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →