473,378 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Add images together

Hi,

I am trying to add together a number of images:

im = image1 + image2 + ...

How can i do this? I have tried to add two image instances
together but i get the following error:
TypeError: unsupported operand type(s) for +: 'instance' and
'instance'

Feb 26 '07 #1
7 3560
iceman schrieb:
Hi,

I am trying to add together a number of images:

im = image1 + image2 + ...

How can i do this? I have tried to add two image instances
together but i get the following error:
TypeError: unsupported operand type(s) for +: 'instance' and
'instance'
Create a new image of double size, and blit the images to the correct
destination.

Diez

Feb 26 '07 #2
What i am trying to do is to separate the foreground object
from the background.All my images contain a foreground object
(i don't have a reference image). What i am trying to do
is to calculate a color-over-time-function for each pixel.
Feb 26 '07 #3
iceman a écrit :
Hi,

I am trying to add together a number of images:

im = image1 + image2 + ...

How can i do this?

I have tried to add two image instances
together but i get the following error:
TypeError: unsupported operand type(s) for +: 'instance' and
'instance'
1/ Python has no builtin "image" type.

2/ I don't know any unambiguous mathematical definition of "image addition"

3/ Whatever "image" object you are using, it comes from a package.
Please read the package documentation.
Feb 26 '07 #4
iceman:
What i am trying to do
is to calculate a color-over-time-function for each pixel.
Are you using PIL?
What does it means color-over-time-function?

Bye,
bearophile

Feb 26 '07 #5
a)Yes, I am using PIL.
b)The color of each pixel over a sequence of frames

Feb 26 '07 #6
iceman wrote:
a)Yes, I am using PIL.
b)The color of each pixel over a sequence of frames

If you want to add numerical values of each pixel's colour then itereate
through the pixels using nested for loops. But I (and I thing the rest
of people here) can't be sure, what in fact you are trying to do.
Please provide us with further info - what are you working at?

zefciu
Feb 26 '07 #7
On Feb 26, 10:16 pm, "iceman" <savva...@gmail.comwrote:
a)Yes, I am using PIL.
b)The color of each pixel over a sequence of frames
I think PIL has it for 2 images, you may have to build a binary tree
of merged images:
http://www.pythonware.com/library/pi...mage.htm#blend

Bye,
bearophile

Feb 26 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: LRW | last post by:
For an e-commerce site, I'm wanting to have it pull 4 random images for the front page from a select list of items from the DB. I can get it to pull randomly and place the images, but I can't...
3
by: Dave | last post by:
Hi, I have an app that uses rollover images, but the images are still pulled from the web server during a mouseover instead of being pulled from memory. The code is as follows: the...
4
by: VR | last post by:
Hi, I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this: <a onmouseover="ActivateImage('MyImage');"...
15
by: Jameson | last post by:
Happy New Year, Everyone! I am trying to figure out how to display a bunch of images (mainly JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a local directory on the system....
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
1
by: ross | last post by:
I am looking for a javascript that will provide a new image each time the viewer opens the web page. At present, I am using a date code and have changed it to show images. But I think it only works...
9
by: valy | last post by:
hi all, how to open two images and then substract both together to get the different? the image will be a grayscale image. A sequence of image is stored in a folder. I want to open two images and...
13
by: seegoon | last post by:
Hi all. So: I've put together a page, in which I want several clickable image maps. I've put those together already. The problem with image maps is that they're not very intuitive, so users don't...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.