Python PIL — Add a border to image

Python script that will add a border to an existing image using the Python PIL library. Here we use the ‘ImageOps.expand()’ method which adds a border to the image given the border width in pixels and pixel fill colour.

Support us by subscribing to our YouTube channel for daily coding content.

https://scriptopia.co.uk/2023/01/14/python-pil-add-a-border-to-image/

--

--

Programming - Projects - Source Code available for everything - Scriptopia.co.uk

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store