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?
--
Wayne Watson (Nevada City, CA)
Web Page: <speckledwithSt ars.net> 4 1933
Corrected misspelling in Subject. The image here is nothing more than a
640x480 byte array. Each byte is a gra[e]yscale value.
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?
--
Wayne Watson (Nevada City, CA)
Web Page: <speckledwithSt ars.net>
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)]
image.putdata(d ata)
image.save('tes t.png')
`data` can be any iterable with byte values.
Ciao,
Marc 'BlackJack' Rintsch
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)]
image.putdata(d ata)
image.save('tes t.png')
`data` can be any iterable with byte values.
Ciao,
Marc 'BlackJack' Rintsch
--
Wayne Watson (Nevada City, CA)
Web Page: <speckledwithSt ars.net>
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)] image.putdata(d ata) image.save('tes t.png')
`data` can be any iterable with byte values.
Ciao, Marc 'BlackJack' Rintsch
--
Wayne Watson (Nevada City, CA)
Web Page: <speckledwithSt ars.net> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: news.microsoft.com |
last post by:
Hello group,
My goal is to attach an image over another image.
Top image should be transparent so the back image is visible through the top
one.
Bellow is a test code in VB.NET. You need to create a form, a button
(Button1) and an Picture Box (picBox).
"watermark.jpg" is any jpg image, "beispiel.tif" is a multipage TIFF image
with the...
|
by: Toby Mathews |
last post by:
Hi,
In an ASP.Net application I want to convert open create a FileStream
object from a System.Drawing.Image - is this possible? I create an instance
of an Image object using the FromFile method, then use the GetThumbnailImage
method to create a second Image. This second one is the one I want to get a
FileStream from, so that I can then use...
|
by: James Coburn's Grey Helmet Hair |
last post by:
When I try to compile my GTK# app, the compiler says:
jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -r -o
buttons.exe
error CS2001: Source file 'buttons.exe' could not be opened
Compilation failed: 1 error(s), 0 warnings
jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -o
buttons.exe...
|
by: John via .NET 247 |
last post by:
Hi,
I'm using the System.Drawing.Bitmap namespace to load an image,and the RotateNoneFlipY method to flip that image before saving.However I have noticed that the saved image appears cropped andhas a large blue area on a particular side, which gets largerevery time the image is flipped again.
I'm assuming that this may be due to a lack of...
|
by: Chris Podmore |
last post by:
This is probably a stupid question but here goes anyway.
What's the best way to design web pages that work in 640x480 or 800x600 and
above? The pages I have created look fine in 800x600 or above but my boss has
just been to a site that runs their desktops at 640x480 and has come back
with a load of comments about how rubbish it all looks. It...
| |
by: Jerry J |
last post by:
I want to use the System.Drawing.Image class. According to the help file,
this is an abstract base class. Because it is supposedly abstract, I created
another class that inherits from it. However, when I did this I got the
following error:
'System.Drawing.Image.Image()' is inaccessible due to its protection level
Looking at other online...
|
by: Dave Keen |
last post by:
Hi all.
Hope you can help me. This should be easy but I can't make this work.
In brief I am building a page of thumbnails using images held in a
SQLServer 2000 database. I do this by creating imagebuttons which
point to a dummy page that takes the image and displays it via
response. All works fine if I use explicit paths to a file...
|
by: luckyguy4ru |
last post by:
Hello every body,
I just joined today this forum hopping that i will get really good help here,
My final project is to refashioned an artist work which is mostly pencil work, i have fake color pallet and fill color to fill and use different color while modifying and existing image, but when i import an image on stage and start drawing, it...
|
by: ThatsIT.net.au |
last post by:
I have this code that writes a pie chart in a asp.net page, but I want to
use it in a server control.
When I try I get a error on the last line "Response.OutputStream"
Obviously there is no response object but how do I write it to screen?
Dim objBitmap As New System.Drawing.Bitmap(400, 440)
Dim objGraphics As System.Drawing.Graphics...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |