Skip to content

Instantly share code, notes, and snippets.

View mattfoster's full-sized avatar

Matt Foster mattfoster

View GitHub Profile
\setlength{\oddsidemargin}{1.4cm}
\setlength{\evensidemargin}{1.4cm}
\setlength{\textwidth}{15cm}
\setlength{\topmargin}{10pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\textheight}{23cm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
@mattfoster
mattfoster / numpy_pil.py
Created August 11, 2008 12:39
Methods for converting between numpy arrays and PIL images. Very useful
import numpy, Image
i = Image.open('lena.jpg')
a = numpy.asarray(i) # a is readonly
i = Image.fromarray(a)