Drawing a 640x480 Raw Image
wolf_tracks at invalid.com
Fri Sep 21 14:48:32 CEST 2007
Oops. What I think I'm looking for is a way to open a data file of records
that are 640x480 that are gray scaled. I probably need something like an
open and a read. Once I've got that, then I need to place the raw image into
a draw area on the canvas, so that I can draw on the image.
W. Watson wrote:
> Very good. I'll give it a try.
> Marc 'BlackJack' Rintsch wrote:
>> On Thu, 20 Sep 2007 20:49:59 -0700, W. Watson wrote:
>>> W. Watson wrote:
>>>> I'm getting a 640x480 greyscale image from a video device. I'd like
>>>> to place it on a canvas and then draw on the image. Does PIL or some
>>>> image facility allow me to do that?
>>> Corrected misspelling in Subject. The image here is nothing more than
>>> a 640x480 byte array. Each byte is a gra[e]yscale value.
>> PIL can do this:
>> from PIL import Image
>> def main():
>> width = 640
>> height = 480
>> image = Image.new('L', (width, height))
>> data = [x * y % 256 for x in xrange(width) for y in xrange(height)]
>> `data` can be any iterable with byte values.
>> Marc 'BlackJack' Rintsch
Wayne Watson (Nevada City, CA)
Web Page: <speckledwithStars.net>
More information about the Python-list