Slide 1

Slide 1 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 1/28 PURELY PYTHON IMAGING WITH PYMAGING PyCon US 2013 Jonas Obrist

Slide 2

Slide 2 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 2/28 JONAS OBRIST github.com/ojii twitter.com/ojiidotch [email protected] django CMS core developer DjangoCon Europe 2012 Organizer Python Enthusiast

Slide 3

Slide 3 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 3/28 NO IDEA ABOUT DIGITAL IMAGING Can't code C Can barely read C Had no idea how images work

Slide 4

Slide 4 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 4/28 GOALS OF PYIMAGING Pure Python solution for common* imaging tasks Easily installable Easy to use Easy to hack Easy to extend Support for Python 2 and 3

Slide 5

Slide 5 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 5/28 ORIGINS OF PYMAGING December 21st 2011 #django-cms on freenode "Installing PIL is hard" < o j i i > a n d I d o n ' t g e t h o w n o o n e c a m e u p w i t h a n a l t e r n a t i v e y e t < o j i i > i s t h a t r e a l l y T H A T h a r d ? < o j i i > a n d d o e s i t r e a l l y * N E E D * C ? < k e z a b e l l e > s o u n d s l i k e y o u ' r e v o l u n t e e r i n g ; ) < o j i i > h a h < o j i i > i w i s h i c o u l d < T r i b a a l > I t h i n k s o m e b o d y j u s t h a s t o d o i t

Slide 6

Slide 6 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 6/28 EARLY RESISTANCE "Not Fast Enough" < G o t e n X i a o > o j i i : t h e p r o b l e m i s t h a t p u r e P y t h o n r u n n i n g o n C P y t h o n i s n ' t f a s t e n o u g h < T r i b a a l > p y p y : ) < o j i i > p y p y !

Slide 7

Slide 7 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 7/28 I TRIED IT ANYWAY (Shoutout to @katylava for picking the name!)

Slide 8

Slide 8 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 8/28 EARLY APPROACH Porting PIL C code line-by-line Previous success with this approach PIL proofed to be too complicated

Slide 9

Slide 9 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 9/28 THE HOLY GRAIL Google

Slide 10

Slide 10 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 10/28 EXISTING (PURE) PYTHON LIBRARIES PNG GIF* JPEG ...

Slide 11

Slide 11 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 11/28 LICENSE HELL All GIF libraries are GPL

Slide 12

Slide 12 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 12/28 GLUING THINGS TOGETHER Different library maturities Different internal storage But working proof-of-concept end of January 2012

Slide 13

Slide 13 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 13/28 HOW PYMAGING WORKS Core provides APIs Packages provide format support

Slide 14

Slide 14 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 14/28 FORMATS Register through setuptools entry points Provide an encoder and/or decoder Separate from the main package

Slide 15

Slide 15 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 15/28 CORE Defines the internal data structure Defines the API Keeps track of installed formats Implements basic algorithms

Slide 16

Slide 16 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 16/28 HOW IMAGES ARE STORED INTERNALLY P i x e l A r r a y and friends Flat a r r a y . a r r a y of pixel data High-level API to manipulate pixels and the canvas

Slide 17

Slide 17 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 17/28 STATE OF PYMAGING

Slide 18

Slide 18 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 18/28 FORMATS PNG encoding/decoding JPG decoding (broken) BMP decoding PSD (by Mikhail Korobov)

Slide 19

Slide 19 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 19/28 APIS Resize/Crop (Thumbnailing) Affine transforms (thanks Craig de Stigter) Rotation Drawing Blit (merging)

Slide 20

Slide 20 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 20/28 PYTHON 3 Python 2.6 ~ 3.3 Not as hard as I thought Pymaging only handles bytes, not strings New libraries should really support 3!

Slide 21

Slide 21 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 21/28 LESSONS LEARNED Imaging is hard... ...but not impossible!

Slide 22

Slide 22 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 22/28 FORMATS Level of documentation varies a lot! PNG is amazing! BMP is weird JPEG is complicated GIF is really close to being easy

Slide 23

Slide 23 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 23/28 PYPY IS AWESOME The primary "speed" strategy Very helpful developers They fix PyPy if you find slow parts

Slide 24

Slide 24 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 24/28 YOU'RE NOT THE FIRST Chances are somebody tried before Google! Build on others work

Slide 25

Slide 25 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 25/28 FUTURE Fix JPEG Fix bugs Delayed loading

Slide 26

Slide 26 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 26/28 I NEED HELP You can most likely contribute Pick a format, implement it Pick a format, fix it Ask me for help

Slide 27

Slide 27 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 27/28 PYCON SPRINTS Come talk to me

Slide 28

Slide 28 text

3/17/13 reveal.js - The HTML Presentation Framework file:///home/jonas/Ubuntu One/presentations/pymaging/local/index.html#/ 28/28 THANK YOU / QUESTIONS? github.com/ojii/pymaging github.com/ojii/pymaging-png github.com/ojii/pymaging-bmp github.com/ojii/pymaging-jpg twitter.com/ojiidotch [email protected] github.com/ojii