Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PIL import Image
- def convert_to_grayscale_bmp(input_path, output_path):
- img = Image.open(input_path)
- grayscale_img = img.convert('L')
- grayscale_img.save(output_path, 'BMP')
- input_file = sys.argv[1]
- output_file = input_file.strip(".jpg") + ".bmp"
- convert_to_grayscale_bmp(input_file, output_file)
Advertisement
Add Comment
Please, Sign In to add comment