How Computers Store Pictures, Music, and Video
📋 Before You Start
To get the most from this chapter, you should be comfortable with: foundational concepts in computer science, basic problem-solving skills
How Computers Store Pictures, Music, and Video
You take a photo with your phone, listen to music on Spotify, and watch movies on Netflix. But how does a computer store these? How does a picture become binary (1s and 0s)?
Pictures: Breaking into Pixels
Every picture is made up of tiny squares called pixels. If you zoom in on a photo on your phone, you'll see it's made of small dots. Each dot is a pixel.
The more pixels, the higher the resolution. A small photo might be 100×100 pixels (10,000 pixels total). A phone camera photo is typically 4000×3000 pixels (12 million pixels). A large poster might be 10000×10000 pixels (100 million pixels).
Each pixel stores a color. The most common system is RGB (Red, Green, Blue):
Red value: 0-255 — How much red in this pixel
Green value: 0-255 — How much green in this pixel
Blue value: 0-255 — How much blue in this pixel
By mixing different amounts of red, green, and blue, you can create any color:
Red = (255, 0, 0)
Green = (0, 255, 0)
Blue = (0, 0, 255)
White = (255, 255, 255)
Black = (0, 0, 0)
Yellow = (255, 255, 0)
Orange = (255, 165, 0)
Each number requires 1 byte (8 bits). So each pixel requires 3 bytes (red + green + blue).
A photo from your phone camera (4000×3000 pixels) would be:
4000 × 3000 × 3 bytes = 36,000,000 bytes = 36 MB
36 megabytes! That's why your phone storage fills up with photos.
Image Compression: Making Photos Smaller
But wait, you can take hundreds of photos, and they don't take 36 MB each. Why?
Because of compression. Your phone uses compression algorithms (JPEG format) to shrink the file size.
JPEG compression works by removing information your eyes won't notice. For example:
- If a wall has 1000 pixels of nearly white color, maybe 800 of them are just white, and you don't need to store each one separately
- Your eyes are less sensitive to color detail than brightness detail, so you can store less color information
- Small details are removed because your eyes don't notice them anyway
With JPEG compression, that 36 MB photo becomes 3-5 MB. That's 10 times smaller!
Different formats have different compression:
JPEG: Good compression, works for photos, quality loss is invisible
PNG: Lossless (no quality loss), larger files, good for graphics
GIF: Very compressed, used for animations and simple graphics
WebP: Modern format, even better compression than JPEG
Sound and Music: Sampling Audio
How does your computer store a Coldplay song or a cricket commentary?
Sound is a wave — a vibration in the air. To store sound digitally, the computer takes "samples" of the sound wave at regular intervals.
Sampling rate: How many samples per second
CD quality music uses 44,100 samples per second (44.1 kHz). Professional studio quality uses 48,000 Hz or higher. Telephone quality might use 8,000 Hz (lower quality).
Each sample is a number representing the sound wave's height at that moment:
Bit depth: How many bits per sample
CD quality uses 16 bits per sample. 16 bits can represent 65,536 different values (from -32768 to 32767). This is enough for very high-quality sound.
A stereo song (two channels: left and right) takes:
44,100 samples/sec × 16 bits/sample × 2 channels = 1,411,200 bits/second
= 176,400 bytes/second
= About 10.6 MB per minute
A 3-minute song would be:
10.6 MB × 3 = 31.8 MB uncompressed!
But Spotify, Apple Music, and YouTube Music don't send you 31 MB per song. They use compression (MP3, AAC, OGG formats).
Audio Compression: MP3 and Beyond
MP3 compression (like JPEG for images) removes audio information your ears won't notice:
- Very high frequencies (above 20 kHz) that humans can't hear anyway
- Very quiet sounds that are masked by louder sounds nearby
- Repetitive patterns that can be simplified
A 3-minute song in MP3 format (256 kbps quality) is about 5.8 MB. That's 5 times smaller than the original!
Different quality settings:
128 kbps: Low quality, small file (3 MB for 3 min), used for old videos
192 kbps: Good quality, medium file (4.5 MB for 3 min), used by streaming services
256-320 kbps: High quality, larger file (6-7 MB), used by music enthusiasts
FLAC (lossless): Full quality, no compression, massive file (30 MB), used by audiophiles
Video: Combining Images and Sound
A video is actually many images (frames) played in sequence, combined with sound.
Video quality is measured in:
Frame rate: How many images per second
- 24 fps: Film standard
- 30 fps: TV standard
- 60 fps: Smooth action, sports
- 120 fps: Ultra-smooth, slow-motion capable
Resolution: Size of each frame
- 480p (854×480): Standard definition
- 720p (1280×720): HD
- 1080p (1920×1080): Full HD
- 4K (3840×2160): Ultra HD
A 1-minute video at 1080p, 30fps, would be:
1920 × 1080 pixels × 3 bytes/pixel × 30 frames/sec × 60 seconds = 11 GB uncompressed!
That's way too big. So videos use compression (H.264, H.265, VP9 codecs).
With compression, a 1-hour movie at 1080p is about 2-4 GB (depending on quality). Netflix varies based on your internet speed (1 GB for low quality, 3 GB for high quality).
File Sizes and Formats
Type Uncompressed Compressed Format
Photo 36 MB 3-5 MB JPEG
Song (3 min) 31.8 MB 5-8 MB MP3
Movie (1 hr) 11 GB 2-4 GB H.264
Streaming: Not Downloading
When you watch Netflix or YouTube, you're not downloading the entire movie. You're streaming — receiving small chunks of video while watching.
Netflix adapts the quality based on your internet speed:
- Poor connection: 480p quality, 0.5-1 GB per hour
- Good connection: 1080p quality, 3 GB per hour
- Excellent connection: 4K quality, 7 GB per hour
Your phone buffers (pre-downloads) a few seconds of video ahead. As you watch, more data keeps downloading in the background.
Data Backup: Why Compression Matters
Say you want to back up your phone to cloud storage (Google Drive, iCloud, OneDrive):
- 1000 uncompressed photos: 36,000 MB = 36 GB
- 1000 compressed photos (JPEG): 4,000 MB = 4 GB
Compression saves you 32 GB of storage and bandwidth!
- Pixel — Smallest unit of a digital image (tiny square)
- Resolution — Number of pixels in an image (width × height)
- RGB — Color model using Red, Green, Blue channels
- Compression — Reducing file size by removing unnecessary data
- Lossy Compression — Removes data you won't notice (JPEG, MP3)
- Lossless Compression — Reduces file without losing data (PNG, FLAC)
- Sampling — Recording audio at regular intervals
- Bit Depth — Number of bits used per audio sample
- Frame Rate — Number of images per second in a video
- Codec — Algorithm for encoding/decoding media
- Streaming — Receiving media in chunks while watching/listening
- Bandwidth — Amount of data transferred per second
📝 Key Takeaways
- ✅ This topic is fundamental to understanding how data and computation work
- ✅ Mastering these concepts opens doors to more advanced topics
- ✅ Practice and experimentation are key to deep understanding
🇮🇳 India Connection
Indian technology companies and researchers are leaders in applying these concepts to solve real-world problems affecting billions of people. From ISRO's space missions to Aadhaar's biometric system, Indian innovation depends on strong fundamentals in computer science.
Thinking Like a Computer Scientist
Before we dive into How Computers Store Pictures, Music, and Video, let me tell you something important. The most valuable skill in computer science is not memorising facts or typing fast. It is a way of THINKING. Computer scientists look at big, messy, confusing problems and break them down into small, simple steps. They find patterns. They test ideas. They are not afraid of making mistakes because every mistake teaches them something.
Right now, India has the second-largest number of internet users in the world — over 900 million people! And the companies building the apps and services these people use need millions more computer scientists. Many of them will be people your age, learning these concepts right now. This chapter on how computers store pictures, music, and video is one more step on that journey.
How Computers Changed India
India has been transformed by computer technology in ways that were unimaginable just 20 years ago. Let us look at the numbers:
INDIA'S DIGITAL TRANSFORMATION:
UPI (Unified Payments Interface):
├── 2016: Launched with 0 transactions
├── 2020: 2 billion transactions/month
├── 2024: 10 billion transactions/month
└── Used by: Google Pay, PhonePe, Paytm, BHIM
Aadhaar (Digital Identity):
├── World's largest biometric system
├── 1.4 billion people enrolled
└── Used for: Bank accounts, SIM cards, govt subsidies
India Stack:
├── Aadhaar (Identity) + UPI (Payments)
├── DigiLocker (Documents) + ONDC (Commerce)
└── Being studied and copied by 40+ countries!
IT Industry:
├── Revenue: $245 billion (2024)
├── Employs: 5.4 million people
└── Companies: TCS, Infosys, Wipro, HCL, Tech MahindraThink about this: your grandparents probably had to stand in line at a bank for hours just to send money to someone. Today, you can send money to anyone in India in 2 seconds using UPI on your phone — for FREE! No other country in the world has a system this advanced. India built it from scratch, and now countries around the world are trying to copy it. Computer science made all of this possible.
Did You Know?
🍕 Swiggy and Zomato process millions of orders per day. Every time you order food on Swiggy or Zomato, a complex system springs into action: your order is received, stored in a database, matched with a restaurant, tracked in real-time, and delivered. The engineering behind this would have seemed like science fiction 15 years ago. Two Indian apps, built by Indian engineers, feeding millions of Indians every day.
💳 India Stack — the world's most advanced digital infrastructure. Aadhaar (biometric ID for 1.4 billion people), UPI (instant digital payments), and ONDC (open network for e-commerce) are part of the India Stack. This is not Western technology adapted for India — this is Indian innovation that the world is trying to copy. The software engineers who built this started exactly where you are.
🎬 Netflix uses algorithms developed in India. Recommendation algorithms that suggest which movie you should watch next? Many Netflix engineers are based in Bangalore and Hyderabad. When you see "Recommended for You" on any streaming platform, there is a good chance an Indian engineer designed that algorithm.
📱 India is the world's largest developer of mobile apps. The most downloaded apps globally are built by Indian companies: WhatsApp (used by billions), Hike (messaging), and many others. Indian startup founders are launching companies in AI, biotech, and space technology. Your peers are already building the future.
The UPI Revolution as a CS Case Study
Before UPI, sending money meant NEFT forms, IFSC codes, 24-hour waits, and fees. UPI abstracted all that complexity behind a simple VPA (Virtual Payment Address like name@upi). This is the power of abstraction — hiding complex implementation behind a simple interface. Under the hood, UPI uses encryption (security), API calls (networking), database transactions (data management), and load balancing (distributed systems). Every CS concept you learn shows up somewhere in UPI's architecture.
How It Works — The Process Explained
Let us walk through the process of how computers store pictures, music, and video in a way that shows how engineers think about problems:
Step 1: Define the Problem Clearly
Engineers always start here. What exactly needs to happen? What are the inputs? What should the output be? What could go wrong? In our case, with how computers store pictures, music, and video, we need to understand: what data are we working with? What transformations need to happen? What are the constraints?
Step 2: Design the Approach
Before writing any code or building anything, engineers draw diagrams. They sketch out: how will data flow? What are the main stages? Where are the bottlenecks? This is like an architect drawing blueprints before constructing a building.
Step 3: Implement the Core Logic
Now we translate the design into actual code or systems. Each component handles its specific responsibility. For how computers store pictures, music, and video, this might involve: data structures (how to organize information), algorithms (step-by-step procedures), and error handling (what happens if something goes wrong).
Step 4: Test and Verify
Engineers test their work obsessively. They try normal cases, edge cases, and intentionally broken cases. They measure performance: is it fast enough? Does it use too much memory? Are there bugs? This testing phase often takes as long as the implementation phase.
Step 5: Deploy and Monitor
Once tested, the system goes live. But engineers do not stop there. They monitor it 24/7: How many requests per second? Is there any lag? Are users happy? If problems appear, engineers can quickly fix them without stopping the entire system.
Training a Simple AI Model
Let us see how we can train a machine learning model in Python. Do not worry if you do not understand every line — focus on the IDEA:
# Step 1: Prepare the data
# We have information about houses: size and price
house_sizes = [600, 800, 1000, 1200, 1500, 1800, 2000]
house_prices = [30, 40, 50, 60, 75, 90, 100]
# Prices are in lakhs (₹)
# Step 2: Find the pattern
# The computer figures out: Price ≈ 5 × Size/100
# (bigger house = higher price — makes sense!)
# Step 3: Make a prediction
new_house_size = 1600 # square feet
predicted_price = 5 * (1600 / 100) # = ₹80 lakhs
print(f"A {new_house_size} sq ft house costs about ₹{predicted_price} lakhs")This is called linear regression — one of the simplest machine learning algorithms. The model finds a straight-line relationship between input (house size) and output (price). Real-world models used by Housing.com or 99acres use dozens of features: location, number of bedrooms, floor number, age of building, nearby schools, metro distance, and more. But the fundamental idea is the same: find patterns in data, then use those patterns to make predictions.
Real Story from India
Priya Orders Food Using UPI
Priya is a college student in Mumbai. It is 9 PM, she is hungry but broke until her salary arrives in 2 days. She opens Zomato, orders from her favorite restaurant, and pays using Google Pay (which uses UPI). The restaurant receives the order instantly. A delivery driver gets assigned. The restaurant cooks the food. Fifteen minutes later, it arrives at Priya's door still hot.
Behind this simple 15-minute experience is extraordinary engineering. The order was received by Zomato's servers, stored in databases, checked for inventory, forwarded to the restaurant's system, assigned to a driver using optimization algorithms, tracked in real-time, and processed through payment systems handling billions of rupees daily.
UPI (Unified Payments Interface) was built by NPCI (National Payments Corporation of India) — an organization founded by Indian banks. It handles more transactions per second than all Western payment systems combined. The software engineers who built UPI, Zomato, and Google Pay started where you are: learning computer science fundamentals.
India's startup ecosystem (Swiggy, Zomato, Flipkart, Razorpay) has created millions of jobs and changed how millions of Indians live. The engineers behind these companies earn ₹20-100+ LPA and solve problems affecting 1.4 billion people. This is the kind of impact computer science can have.
Inside the Tech Industry
Let me give you a glimpse of how how computers store pictures, music, and video is applied in production systems at India's top tech companies. At Flipkart, during Big Billion Days, the system handles over 15,000 orders per SECOND. Every one of those orders involves inventory checks, payment processing, fraud detection, warehouse assignment, and delivery scheduling — all happening simultaneously in under 2 seconds. The engineering behind this is extraordinary.
At Razorpay, which processes payments for hundreds of thousands of businesses, the system must handle concurrent transactions while ensuring exactly-once processing (you cannot charge someone's card twice!). This requires distributed consensus algorithms, idempotency keys, and sophisticated error handling. When you see "Payment Successful" on your screen, dozens of systems have communicated, verified, and recorded the transaction in milliseconds.
Zomato's recommendation engine analyses your past orders, location, time of day, weather, and even what people similar to you are ordering to suggest restaurants. This involves machine learning models trained on billions of data points, real-time inference systems, and A/B testing frameworks that compare different recommendation strategies. The "For You" section on your Zomato app is the result of some seriously sophisticated computer science.
Even India's public infrastructure uses these concepts. IRCTC's Tatkal booking system handles millions of simultaneous users at 10 AM, requiring load balancing, queue management, and optimistic locking to prevent overbooking. The Delhi Metro's automated signalling system uses real-time algorithms to maintain safe distances between trains. Traffic management systems in cities like Bangalore and Pune use computer vision to analyse traffic density and optimise signal timings.
Quick Knowledge Check ✓
Challenge yourself with these questions:
Question 1: What are the main steps involved in how computers store pictures, music, and video? Can you list them in order?
Answer: Check the "How It Works" section above. If you can recite the steps from memory, excellent!
Question 2: Why is how computers store pictures, music, and video important in the context of Indian technology companies like Flipkart or UPI?
Answer: These companies rely on how computers store pictures, music, and video to serve millions of users simultaneously and ensure reliability.
Question 3: If you were designing a system using how computers store pictures, music, and video, what challenges would you need to solve?
Answer: Performance, reliability, maintainability, security — check these against what you learned in this chapter.
Key Vocabulary
Here are important terms from this chapter that you should know:
🔬 Experiment: Measure Algorithm Speed
Here is a practical experiment: write two Python programs — one that uses a list and one that uses a dictionary — to check if a word exists in a collection of 10,000 words. Time both programs. You will discover that the dictionary version is dramatically faster (O(1) vs O(n)). Now try it with 100,000 words, then 1,000,000. Watch how the difference grows exponentially. This single experiment will teach you more about data structures than reading a textbook chapter.
Connecting the Dots
How Computers Store Pictures, Music, and Video does not exist in isolation — it connects to everything else in computer science. The concepts you learned here will show up again and again: in web development, in AI, in app building, in cybersecurity. Computer science is like a giant jigsaw puzzle, and each chapter you complete adds another piece. Some day, you will step back and see the complete picture — and it will be beautiful.
India is producing the next generation of global tech leaders. Students from IITs, NITs, IIIT Hyderabad, and BITS Pilani are founding companies, leading engineering teams at Google and Microsoft, and solving problems that affect billions of people. Your journey through these chapters is the same journey they started on. Keep building, keep experimenting, and most importantly, keep enjoying the process.
Crafted for Class 4–6 • Digital Media • Aligned with NEP 2020 & CBSE Curriculum