Load the Image
In Keras, load_img() function is used to load image. The image loaded using load_img() method is PIL object. Certain information can be accessed from loaded images like image type which is PIL object, the format is JPEG, size is (6000,4000), mode is RGB, etc. We are using dog images throughout the article.
Python3
import keras from keras.preprocessing.image import load_img # load the image img = load_img( 'dog.jpg' ) # find more about the image print ( type (img)) print (img. format ) print (img.mode) print (img.size) # show the image img.show() |
Output:
Image Processing with Keras in Python
In this article, we are doing Image Processing with Keras in Python. Keras API is a deep learning library that provides methods to load, prepare and process images.
We will cover the following points in this article:
- Load an image
- Process an image
- Convert Image into an array and vice-versa
- Change the color of the image
- Process image dataset