Skip to content

Instantly share code, notes, and snippets.

View PlastMan420's full-sized avatar

Mustafa Aladdin PlastMan420

  • Egypt
View GitHub Profile
@PlastMan420
PlastMan420 / sketcher.py
Created May 15, 2020 19:52
This applies a sketch effect to an image > python sketcher.py <input file arg>
from PIL import Image, ImageOps, ImageFilter
import os, sys
import numpy as np
from datetime import datetime
# Dodge blend effect
def dodge(front,back):
# The formula comes from http://www.adobe.com/devnet/pdf/pdfs/blend_modes.pdf
result = (back*256.0)/(256.0-front)
result[result>255]=255