diff --git a/Demos/README.md b/Demos/README.md index dbcd4afd5..47c869ffd 100644 --- a/Demos/README.md +++ b/Demos/README.md @@ -8,6 +8,7 @@ how to run wget http://upload.wikimedia.org/wikipedia/commons/6/69/Captcha.jpg -O image_resources/captcha.jpg python crop/crop.py + ## Build it on Mac OS X 10.6.* Build an egg for i386 with Python 2.5/Python 2.6 diff --git a/Demos/access_pixels/access_pixels.py b/Demos/access_pixels/access_pixels.py index 56ae56923..eae87c85e 100644 --- a/Demos/access_pixels/access_pixels.py +++ b/Demos/access_pixels/access_pixels.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image +from PIL import Image + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/crop/crop.py b/Demos/crop/crop.py index 5841ad69d..c736da757 100644 --- a/Demos/crop/crop.py +++ b/Demos/crop/crop.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image +from PIL import Image + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/cutting_pasting_and_merging/cutting_pasting_and_merging.py b/Demos/cutting_pasting_and_merging/cutting_pasting_and_merging.py index 251b05df3..32b7df8f0 100644 --- a/Demos/cutting_pasting_and_merging/cutting_pasting_and_merging.py +++ b/Demos/cutting_pasting_and_merging/cutting_pasting_and_merging.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image +from PIL import Image + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/draw_line/draw_line.py b/Demos/draw_line/draw_line.py index 8ba0283e7..f73aae6b6 100644 --- a/Demos/draw_line/draw_line.py +++ b/Demos/draw_line/draw_line.py @@ -1,7 +1,8 @@ #!/usr/bin/env python import os -import Image -import ImageDraw +from PIL import Image +from PIL import ImageDraw + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/draw_points/draw_points.py b/Demos/draw_points/draw_points.py index a03e09aa9..a9689408c 100644 --- a/Demos/draw_points/draw_points.py +++ b/Demos/draw_points/draw_points.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os -import Image -import ImageDraw +from PIL import Image +from PIL import ImageDraw PWD = os.path.dirname(os.path.realpath(__file__)) diff --git a/Demos/draw_polygon/draw_polygon.py b/Demos/draw_polygon/draw_polygon.py index aed41c792..6fa81c023 100644 --- a/Demos/draw_polygon/draw_polygon.py +++ b/Demos/draw_polygon/draw_polygon.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os -import Image -import ImageDraw +from PIL import Image +from PIL import ImageDraw PWD = os.path.dirname(os.path.realpath(__file__)) diff --git a/Demos/draw_rectangle/draw_rectangle.py b/Demos/draw_rectangle/draw_rectangle.py index f1f24de23..8e2011311 100644 --- a/Demos/draw_rectangle/draw_rectangle.py +++ b/Demos/draw_rectangle/draw_rectangle.py @@ -1,7 +1,8 @@ #!/usr/bin/env python import os -import Image -import ImageDraw +from PIL import Image +from PIL import ImageDraw + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/flip/flip.py b/Demos/flip/flip.py index 25ee02dd8..0903b776e 100644 --- a/Demos/flip/flip.py +++ b/Demos/flip/flip.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image +from PIL import Image + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/grayscale/grayscale.py b/Demos/grayscale/grayscale.py index 31ad92224..ad88ef3c9 100644 --- a/Demos/grayscale/grayscale.py +++ b/Demos/grayscale/grayscale.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image +from PIL import Image + PWD = os.path.dirname(os.path.realpath(__file__)) parent_path = os.path.dirname(PWD) diff --git a/Demos/histogram/histogram.py b/Demos/histogram/histogram.py index c533aea18..a79d579ea 100644 --- a/Demos/histogram/histogram.py +++ b/Demos/histogram/histogram.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os -import Image, ImageDraw +from PIL import Image +from PIL import ImageDraw PWD = os.path.dirname(os.path.realpath(__file__)) @@ -13,16 +14,10 @@ WHITE = 255 im = Image.open(fp = file_path) w, h = im.size[0], im.size[1] - -print "width:", w -print "high:", h - - im = im.draft("L", im.size) pixsels = im.load() - for x in range(w): for y in range(h): if pixsels[x, y] > 128: diff --git a/Demos/image_info/get_img_info.py b/Demos/image_info/get_img_info.py index 85a9fc464..e713f0f4b 100644 --- a/Demos/image_info/get_img_info.py +++ b/Demos/image_info/get_img_info.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import os -import Image +from PIL import Image PWD = os.path.dirname(os.path.realpath(__file__)) diff --git a/Demos/rotate/rotate.py b/Demos/rotate/rotate.py index 6fe5412df..c070d6652 100644 --- a/Demos/rotate/rotate.py +++ b/Demos/rotate/rotate.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import os -import Image +from PIL import Image PWD = os.path.dirname(os.path.realpath(__file__)) diff --git a/Demos/thumbnail/thumbnail.py b/Demos/thumbnail/thumbnail.py index 38321a22a..fbb9640de 100644 --- a/Demos/thumbnail/thumbnail.py +++ b/Demos/thumbnail/thumbnail.py @@ -1,6 +1,6 @@ #!/usr/bin/env python import os -import Image +from PIL import Image PWD = os.path.dirname(os.path.realpath(__file__))