Skip to content

Instantly share code, notes, and snippets.

View stoermerjp's full-sized avatar

JP Stoermer stoermerjp

View GitHub Profile
@stoermerjp
stoermerjp / cc.py
Created January 17, 2014 20:37 — forked from shunsukeaihara/cc.py
# -*- coding: utf-8 -*-
import numpy as np
import Image
import sys
def from_pil(pimg):
pimg = pimg.convert(mode='RGB')
nimg = np.asarray(pimg)
nimg.flags.writeable = True
return nimg