In the above code you showed, the image_url is taken from the user input, but you must use the content returned by BeautifulSoup.
https://www.google.com/search?q=scraping+images+python+beautifulsoup
Tutorial from the first link:
import requests
from bs4 import BeautifulSoup
def getdata(url):
r = requests.get(url)
return r.text
htmldata = getdata("https://www.geeksforgeeks.org/")
soup = BeautifulSoup(htmldata, 'html.parser')
for item in soup.find_all('img'):
print(item['src'])
The src in the above is a relative or absolute URL. You need to convert it to an absolute URL and use it in requests.get() (or alternatives), then output from it in Image.open() to retrieve the image. Then use image object where you need to.