Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88021

Re: PIL(LOW) - What am I missing?

Date 2015-03-25 21:23 -0700
From Gary Herron <gherron@digipen.edu>
Subject Re: PIL(LOW) - What am I missing?
References <7029df19-f6c0-4b3f-be11-8ac45752ac68@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.178.1427343841.10327.python-list@python.org> (permalink)

Show all headers | View raw


On 03/25/2015 08:54 PM, kai.peters@gmail.com wrote:
> I create an image as per:
>
>      img  = Image.new('1', (1024, 1280), 1)
> 	
> I then draw on it and do:
>
>      imagedata = list(img.getdata())
>      print len(imagedata)
>
> This gives me 1228800 instead of the expected 1310720 (1024 * 1280)	
> - any ideas what I am missing?
>
> As always, any help much appreciated.
>
> Kai

Are you sure?

Both Python2 and Python3 give me the expected 1310720,

I'm running PILLOW version 2.6.1 on Linux (with both Python 3.4.2 and 
Python 2.7.8).

 >>> from PIL import Image
 >>> img  = Image.new('1', (1024, 1280), 1)
 >>> imagedata = list(img.getdata())
 >>> print len(imagedata)
1310720



-- 
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PIL(LOW) - What am I missing? kai.peters@gmail.com - 2015-03-25 20:54 -0700
  Re: PIL(LOW) - What am I missing? Gary Herron <gherron@digipen.edu> - 2015-03-25 21:23 -0700
  Re: PIL(LOW) - What am I missing? kai.peters@gmail.com - 2015-03-25 21:46 -0700

csiph-web