Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade --quiet
import numpy as np
from PIL import Image
import cv2
import urllib
import matplotlib.pyplot as plt

The image contains 4 lines of pixels. Each line of pixels contains 5 pixels. Each pixel contains 3 bytes (representing the red, green and blue values of the pixel colour):

url = 'https://www.pythoninformer.com/img/numpy/image-bytes.png'
image = Image.open(urllib.request.urlopen(url))
image
Notebook Image

RGB images are usually stored as 3 dimensional arrays of 8-bit unsigned integers. The shape of the array is:

height x width x 3.

(red=255, green=128, blue=0)