#This is script is written for python3. #It is compatible with PIP '8.3.1' import sys import os import argparse from PIL import Image, ImageFilter from pathlib import Path input_file = 'input_new' if len(sys.argv) != 3: print("Usage: python3 smoothing.py image_file smoothing_range") img = sys.argv[1] smoothing_range = sys.argv[2] smoothing_range = float(smoothing_range) input_img = Image.open(str(img) ) blurred_img = input_img.filter(ImageFilter.GaussianBlur(radius=smoothing_range)) fname = os.path.splitext(os.path.basename(img))[0] out_fname = fname+'_smoothing'+str(smoothing_range)+'.jpg' #print(f"Image {img} successfuly smoothed! Image will be saved in {out_fname blurred_img.save(out_fname)