Skip to content

Instantly share code, notes, and snippets.

@mb6ockatf
Last active April 13, 2024 12:53
Show Gist options
  • Save mb6ockatf/abb98f0591955f677edc17dbee35f68c to your computer and use it in GitHub Desktop.
Save mb6ockatf/abb98f0591955f677edc17dbee35f68c to your computer and use it in GitHub Desktop.
convert image to grayscale
#!/usr/bin/env python3
from PIL import Image
img = Image.open('image.jpg').convert('L')
img.save('greyscale.jpg')
#!/usr/bin/env python3
from PIL import Image
img = Image.open('image.jpg').convert('L')
img.save('greyscale.jpg')
[tool.poetry]
name = "grayscale"
version = "0.1"
description = "convert picture to grayscale"
authors = ["mb6ockatf <mdddmmmm@yandex.ru>"]
license = "AGPL"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
pillow = "^10.3.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment