GIDForums  

Go Back   GIDForums > Computer Programming Forums > Python Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Nov-2007, 04:33
nish nish is offline
New Member
 
Join Date: Nov 2007
Posts: 3
nish is on a distinguished road
Question

I want to make an image transparent


hi to all...
i'm working on an animation where i have to make the picture background.gif transparent.
l'm not able to do it.can you please help me or tell me what codes i should add to make the picture transparent.
thank in advance


Python Code:
import Tkinter
from Tkconstants import *
def window(tk):

    global photo       

    frame=Tkinter.Frame(tk)

    frame.pack()

    

    canvas=Tkinter.Canvas(frame,bg ='white', width=500,height=500)

    canvas.pack()

    

    photo=Tkinter.PhotoImage(file="background.gif")
    canvas.create_image(200, 250, image=photo)

    


root = Tkinter.Tk()

root.title("Simulation of infectious diseases")

window(root)

root.mainloop()
Last edited by LuciWiz : 06-Nov-2007 at 11:52. Reason: Please insert your Python code between [py] & [/py] tags
  #2  
Old 09-Nov-2007, 11:38
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,635
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: I want to make an image transparent


I don't think Tkinter has that capability, depending on the version you're using. You might have better luck using a GIF viewer program and changing the alpha settings there, then resaving it.

I don't know if it will help you but you might try the "makegif.py" program from http://www.unixuser.org/~euske/python/index.html.
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.
-------------
Common Sense v2.0-Striving to make the world a little bit smarter.
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image onto JFrame tedds Java Forum 8 25-Oct-2007 20:04
Importing images arety33 Java Forum 1 12-Jul-2007 13:28
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 14:46
GIM gidedit - a fltk fluid resize project cable_guy_67 FLTK Forum 2 01-Jun-2005 15:00
Checking source codes of image, audio and video files onauc C Programming Language 5 26-Feb-2005 21:47

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:38.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.