There are a tons of image already – instead of going though the pain staking process of creating by hand our own images, I am going to use an image I already captured.
And yes, it is of my three cats. I am also adding to the collection of cat images on the internet.
Here is the image below – feel free to use it in any of the examples.
The python code below uses PILLOW to read in the image, and then using NUMPY we can convert it into an array. Since it is a color image it will become a 3d array with the shape of 844,600,3.
#%% from PIL import Image import numpy as np import matplotlib.pyplot as plt # Image File we are loading imageFile = r"D:\temp\thecats.jpg" # Pillow Image Object inputImage = Image.open(imageFile) # Convert To Numpy Array imageArray = np.array(inputImage) # Using matplot to load the array into their image display function plt.imshow(imageArray) # Shows the Image plt.show()
Color images are great – however they do require some more RAM and processing power. Up next we will take a look at various ways to convert a color image to black and white. This will greatly speed things up on lower powered devices.
Have a Project or Idea!?
I am Available for Freelance Projects
My skills are always primed and ready for new opportunities to be put to work, and I am ever on the lookout to connect with individuals who share a similar mindset.
If you’re intrigued and wish to collaborate, connect, or simply indulge in a stimulating conversation, don’t hesitate! Drop me an email and let’s begin our journey. I eagerly anticipate our interaction!