~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to Tests/test_image_histogram.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (1.1.4)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130131204920-7tnuhqhlsqdza4c2
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from tester import *
 
2
 
 
3
from PIL import Image
 
4
 
 
5
def test_histogram():
 
6
 
 
7
    def histogram(mode):
 
8
        h = lena(mode).histogram()
 
9
        return len(h), min(h), max(h)
 
10
 
 
11
    assert_equal(histogram("1"), (256, 0, 8872))
 
12
    assert_equal(histogram("L"), (256, 0, 199))
 
13
    assert_equal(histogram("I"), (256, 0, 199))
 
14
    assert_equal(histogram("F"), (256, 0, 199))
 
15
    assert_equal(histogram("P"), (256, 0, 2912))
 
16
    assert_equal(histogram("RGB"), (768, 0, 285))
 
17
    assert_equal(histogram("RGBA"), (1024, 0, 16384))
 
18
    assert_equal(histogram("CMYK"), (1024, 0, 16384))
 
19
    assert_equal(histogram("YCbCr"), (768, 0, 741))