![]() |
VOOZH | about |
Prerequisites: Pillow(python library)
Padding is the space between the contents, the container, and the border. An image can be considered content to some container and extra padding can be added to it. This article depicts how this can be done. Padding can be added by straightaway supplying the values for the side to be padded. These values can then be passed to the function to create a new image.
This module is not preloaded with Python. So to install it execute the following command in the command-line:
pip install pillow
Input Image:
👁 ImageProgram :
Output:
👁 ImageThe output generated is just the input image with a padding added to it. Here it appears as a border, since the values given for each side were equal. For different values non-uniform padding can be observed.