CV Lab – 1

Computer Vision Lab: Pixels as Numbers

Computer Vision Lab: Pixels as Numbers

Explore how a grayscale image can be stored as a 2D grid of numbers. Change brightness, contrast, resolution and zoom, then compare the picture with its pixel values.

1 pixel = 1 byte In this grayscale example, each pixel stores one 8-bit value.
0 to 255 0 = black, 255 = white, and values in between = shades of gray.
8 bits = 256 values Eight binary digits can represent 2⁸ = 256 different values (0 through 255).
Images are processed in your browser and are not uploaded anywhere.

1. The image

Sample image
Image: 256 × 256 0.066 megapixels Grid: 16 × 16
Shift pixel values darker or lighter.
Separate dark and light values.
More cells show more image detail.
Enlarge or shrink the pixel picture.

2. The bitmap of numbers

Each cell = 1 pixel value
Hover over a cell to inspect it. Pixel: —
Dark cells have low values; light cells have high values. The grid shows the same adjusted grayscale data used to draw the image.

What should you notice?

Pixel value: Each cell stores a number from 0 to 255. A value of 0 appears black; 255 appears white.

Grayscale: One number per pixel is enough because the pixel represents only brightness, not a colour.

Image dimensions: An image with width × height pixels has that many pixels. For an uncompressed 8-bit grayscale image, the pixel data uses approximately width × height bytes, excluding file headers and other metadata.

Resolution vs zoom: Resolution changes how many pixel samples are used. Zoom only changes how large the image appears on screen.

Try this: Move brightness to −60, then +60. Set contrast to 40%, then 160%. Reduce grid resolution to 8 × 8 and increase it to 32 × 32. What happens to the values and the visible detail?
error: Content is protected !!