💻 Computer Science · Topic 16 of 80

Images and Pixels

Images are grids of pixels each with colour values.

Interactive labResize the slices

About this topic

A digital image is a grid of tiny squares called pixels, each storing a colour as numbers. In the common RGB model, each pixel has red, green and blue values from 0 to 255, so one pixel needs 24 bits, or three bytes. Resolution is the number of pixels, such as 1920 by 1080, and colour depth is the number of bits per pixel.

More pixels give more detail but a larger file. File size in bits equals width times height times colour depth, so a 1920 by 1080 image at 24 bits is about 6.2 million bytes before compression. Raster images such as JPEG and PNG store pixels, while vector images store shapes and formulas, so they scale without becoming blurry.

Mixing light is how screens work: full red and green with no blue appears yellow, and all three at 255 give white. A common misconception is that zooming in on a photo reveals hidden detail; it only enlarges the existing pixels, as seen in movies versus reality. Another is that more megapixels always means better photos, when lens and sensor quality matter as well. Use PNG for sharp graphics and JPEG for photographs.

Key ideas

  1. RGB uses 3 bytes per pixel
  2. Resolution counts pixels
  3. Compression reduces size

Quick check

Use cases: where Images and Pixels helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is Images and Pixels?

Images are grids of pixels each with colour values.

What will I learn in Images and Pixels?

RGB uses 3 bytes per pixel. Resolution counts pixels. Compression reduces size.

Is Images and Pixels part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Images and Pixels lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Images and Pixels?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science