PIL, as its name suggest, is an imaging library for python. I used PIL to get every pixel of an image as 2x2 array information. With that I could modify it with many possibilities; edge detection, black and white transformation, log transformation, creating watermark, etc.

{update: I install this PIL module on my OS X El Capitan too, :), and easier



Installing PIL is an easy task, if we have its prerequities installed. Just download it and extract it and then install using this command

Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
...
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ 


Oops, it is failed to install, it tell me that there is no gcc-4.2 on my machine, and that's true. I've modified my /usr/bin/gcc to point /usr/local/bin/gcc.

I have gcc 4.2 from Xcode4.2, which actually llvm-gcc. My existing gcc is gcc-4.6.2 so I cheatedโ€ฆ I created symlink named gcc-4.2 on /usr/bin pointing /usr/local/bin/gcc


Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ ln -s /usr/local/bin/gcc /usr/bin/gcc-4.2
ln: /usr/bin/gcc-4.2: Permission denied
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ sudo ln -s /usr/local/bin/gcc /usr/bin/gcc-4.2
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ 

Still error, :(


gcc-4.2: error: x86_64: No such file or directory
gcc-4.2: error: unrecognized option โ€˜-archโ€™
gcc-4.2: error: unrecognized option โ€˜-archโ€™
error: command 'gcc-4.2' failed with exit status 1

Hm, maybe if I'm linking /usr/bin/gcc-4.2 to /usr/bin/llvm-gcc-4-2; it's gcc-4.2 after all, if we ignore llvm (don't know what is it stand for). It doesn't hurt if I'm trying, so..

Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ sudo rm /usr/bin/gcc-4.2 
Password:
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ python setup.py install
running install
running build
running build_py
running build_ext
-
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      darwin 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
              [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
--------------------------------------------------------------------
--- TKINTER support available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
creating /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL.pth
Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ 

Wow, success 

Well, no need gcc4.6.2 afterall, just create symbolic link of llvm-gcc-4.2 named gcc-4.2,:)

test


Nugrohos-MacBook-Pro:Imaging-1.1.7 nugroho$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import image
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named image
>>> import Image
>>> 

OK
7

View comments



  1. Layang Kangen
    via IFTTT
    0

    Add a comment



  2. Sing Sing Sing
    via IFTTT
    0

    Add a comment



  3. Layang Kangen. #didikempot #cover #multiinstrumentalist #musician #musisimalang #yamaha #ag06 #mixer #zoomh5 #garageband #finalcutpro #canon #eosm6 #canon22mm #indomusikgram #indozonemusic #cloudmusikgram #covermusikgramm #coverinsong #bestmusicshots #indonesia #damaiindonesiaku #damai #mantan #mahasiswaum ๐Ÿ˜
    via IFTTT
    0

    Add a comment



  4. Rayuan Pulau Kelapa.
    via IFTTT
    0

    Add a comment



  5. Birama ganjil di pagi hari, ๐Ÿ˜. (Saya suka ketukan 7/8)
    via IFTTT
    0

    Add a comment



  6. Manuk Dadali
    via IFTTT
    0

    Add a comment



  7. Killing Me Softly
    via IFTTT
    0

    Add a comment



  8. Tears in Heaven. #EricClapton #cover #multiinstrumentalist #musician #musisimalang #yamaha #ag06 #mixer #zoomh5 #garageband #finalcutpro #canon #eosm6 #7artisans75mm28 #indomusikgram #indozonemusic #cloudmusikgram #covermusikgramm #coverinsong #bestmusicshots #indonesia #damaiindonesiaku #damai #mantan #mahasiswaum ๐Ÿ˜
    via IFTTT
    0

    Add a comment



  9. Happy... #pharrellwilliams #cover #openhandeddrumming #openhandedplaying #drumeoshed #multiinstrumentalist #musician #musisimalang #yamaha #ag06 #mixer #zoomh5 #garageband #finalcutpro #canon #eosm6 #7artisans75mm28 #indomusikgram #indozonemusic #cloudmusikgram #covermusikgramm #coverinsong #bestmusicshots #indonesia #damaiindonesiaku #damai #mantan #mahasiswaum ๐Ÿ˜ (mouthpiece dan reed #vandoren beli di @metro_mlg )
    via IFTTT
    0

    Add a comment



  10. Ritual Drummer Normal saat ingin memainkan set drum saya. Naikkan hi-hat, ubah posisi floor tom, ubah posisi kursi, cari tahu โ€œapaโ€ ada โ€œdi manaโ€, ๐Ÿ˜…
    via IFTTT
    0

    Add a comment

Archive
Label
Popular Posts
Popular Posts
Loading