Skip to content

Instantly share code, notes, and snippets.

View niceTeen84's full-sized avatar
:electron:
I feel hungry.

Allen niceTeen84

:electron:
I feel hungry.
  • the blue planet
View GitHub Profile
@niceTeen84
niceTeen84 / docker-registry-mirrors.md
Created July 24, 2024 02:34 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@niceTeen84
niceTeen84 / brightness.py
Created February 17, 2021 17:29 — forked from kmohrf/brightness.py
Calculate Image brightness with Python Pillow
import sys
from PIL import Image
def calculate_brightness(image):
greyscale_image = image.convert('L')
histogram = greyscale_image.histogram()
pixels = sum(histogram)
brightness = scale = len(histogram)