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


Groups > comp.lang.python > #21187 > unrolled thread

How to convert simple B/W graphic to the dot matrix for the LED display/sign

Started byPetr Jakes <petr.jakes.tpc@gmail.com>
First post2012-03-04 02:28 -0800
Last post2012-03-05 05:53 -0800
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  How to convert simple B/W graphic to the dot matrix for the LED display/sign Petr Jakes <petr.jakes.tpc@gmail.com> - 2012-03-04 02:28 -0800
    Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-04 10:54 +0000
      Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign Petr Jakes <petr.jakes.tpc@gmail.com> - 2012-03-04 04:47 -0800
        Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign Max Erickson <maxerickson@gmail.com> - 2012-03-04 14:09 +0000
          Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign Petr Jakes <petr.jakes.tpc@gmail.com> - 2012-03-05 05:53 -0800

#21187 — How to convert simple B/W graphic to the dot matrix for the LED display/sign

FromPetr Jakes <petr.jakes.tpc@gmail.com>
Date2012-03-04 02:28 -0800
SubjectHow to convert simple B/W graphic to the dot matrix for the LED display/sign
Message-ID<94052541-e1e0-43b6-b434-59e79518cf4a@q18g2000yqh.googlegroups.com>
I would like to convert simple B/W graphic to the 432x64 pixel matrix.
It is intended to display this graphic on the one color LED matrix
sign/display (432 LEDs width, 64 LEDs height).
I am experimenting with the PIL, but I did not find solution there.

It will be really helpful If somebody here can show me the direction
to go?

Regards
Petr

[toc] | [next] | [standalone]


#21189

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-03-04 10:54 +0000
Message-ID<4f5349f2$0$29989$c3e8da3$5496439d@news.astraweb.com>
In reply to#21187
On Sun, 04 Mar 2012 02:28:16 -0800, Petr Jakes wrote:

> I would like to convert simple B/W graphic to the 432x64 pixel matrix.
> It is intended to display this graphic on the one color LED matrix
> sign/display (432 LEDs width, 64 LEDs height). I am experimenting with
> the PIL, but I did not find solution there.
> 
> It will be really helpful If somebody here can show me the direction to
> go?

What file format is the graphic in? How big is it?

What file format do you want it to be?


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#21192

FromPetr Jakes <petr.jakes.tpc@gmail.com>
Date2012-03-04 04:47 -0800
Message-ID<d2bb7721-2472-4863-b73d-6aa128b717a3@q12g2000yqg.googlegroups.com>
In reply to#21189
> What file format is the graphic in? How big is it?
>
> What file format do you want it to be?
>

Now, I am able to create the png file with the resolution 432x64 using
PIL (using draw.text method for example).

I would like to get the 432x64 True/False (Black/White) lookup table
from this file, so I can switch LEDs ON/OFF accordingly.

--
Petr

[toc] | [prev] | [next] | [standalone]


#21198

FromMax Erickson <maxerickson@gmail.com>
Date2012-03-04 14:09 +0000
Message-ID<mailman.380.1330870177.3037.python-list@python.org>
In reply to#21192
Petr Jakes <petr.jakes.tpc@gmail.com> wrote:

> 
>> What file format is the graphic in? How big is it?
>>
>> What file format do you want it to be?
>>
> 
> Now, I am able to create the png file with the resolution 432x64
> using PIL (using draw.text method for example).
> 
> I would like to get the 432x64 True/False (Black/White) lookup
> table from this file, so I can switch LEDs ON/OFF accordingly.
> 
> --
> Petr
> 

The convert and load methods are one way to do it:

>>> import Image
>>> im=Image.new('L', (100,100))
>>> im=im.convert('1')
>>> px=im.load()
>>> px[0,0]
0

That's the numeral one in the argument to convert. The load method 
returns a pixel access object.


Max

[toc] | [prev] | [next] | [standalone]


#21231

FromPetr Jakes <petr.jakes.tpc@gmail.com>
Date2012-03-05 05:53 -0800
Message-ID<24a8132d-1e90-4c77-9bac-309a41395cb6@y17g2000yqg.googlegroups.com>
In reply to#21198
> >>> import Image
> >>> im=Image.new('L', (100,100))
> >>> im=im.convert('1')
> >>> px=im.load()
> >>> px[0,0]

Thanks, load() method works great.

One more question.

Finally, I would like to store array in the database.

What is the best way to store arrays?

Petr



[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web