Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Image Blender
# Take r, g and b channels from separate images. Python randomises the list for extra fun.
from PIL import Image
import os, math, sys, random
fileList = os.listdir(".")
(width, height) =[0]).size
nPhotos = len(fileList)
dst ="RGB", (width, height))
fileNum = 0
rkeep, g, b =[fileNum]).split()
fileNum = fileNum + 1
r, gkeep, b =[fileNum]).split()
fileNum = fileNum + 1
r, g, bkeep =[fileNum]).split()
Image.merge("RGB", (rkeep, gkeep, bkeep)).save("testbgr.jpg", "JPEG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.