Skip to content

Instantly share code, notes, and snippets.

@weihanglo
weihanglo / draw_gradient_pillow.py
Last active May 8, 2024 09:09
Draw gradient color with Pillow
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw
im = Image.open('img_original.png')
def interpolate(f_co, t_co, interval):
det_co =[(t - f) / interval for f , t in zip(f_co, t_co)]
for i in range(interval):