Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #88019 > unrolled thread
| Started by | kai.peters@gmail.com |
|---|---|
| First post | 2015-03-25 20:54 -0700 |
| Last post | 2015-03-25 21:46 -0700 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.python
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
| From | kai.peters@gmail.com |
|---|---|
| Date | 2015-03-25 20:54 -0700 |
| Subject | PIL(LOW) - What am I missing? |
| Message-ID | <7029df19-f6c0-4b3f-be11-8ac45752ac68@googlegroups.com> |
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
[toc] | [next] | [standalone]
| From | Gary Herron <gherron@digipen.edu> |
|---|---|
| Date | 2015-03-25 21:23 -0700 |
| Message-ID | <mailman.178.1427343841.10327.python-list@python.org> |
| In reply to | #88019 |
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
[toc] | [prev] | [next] | [standalone]
| From | kai.peters@gmail.com |
|---|---|
| Date | 2015-03-25 21:46 -0700 |
| Message-ID | <a64aa768-c23f-4a17-99c5-adcbdbf1e73f@googlegroups.com> |
| In reply to | #88019 |
On Wednesday, 25 March 2015 20:54:21 UTC-7, kai.p...@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?
Please disregard - typo after a long night :(
>
> As always, any help much appreciated.
>
> Kai
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web