uix.image.Image won't show transparent png

832 views
Skip to first unread message

Magnien Sebastien

unread,
Jan 18, 2013, 8:13:39 AM1/18/13
to kivy-...@googlegroups.com
Hello, 

im = Image(source='Test.png')

shows the required file when it is a non-transparent png, and doesn't show anything at all with a transparent one.
Various tests with im.color = [1,1,1,1] or other values didn't change a thing.

I guess a library might be missing; would someone kindly point me to it, or to a better idea if this is not it?

Best regards,

Sébastien

Magnien Sebastien

unread,
Jan 18, 2013, 8:55:46 AM1/18/13
to kivy-...@googlegroups.com
I forgot to mention that Kivy corrupted something on my system: I noticed when running the hello world sample that curious artifacts appeared in its title bar, and in unity launcher (ubuntu 12.04 + ppa:xorg-egers for sandy bridge compatibility) - http://s1341.beta.photobucket.com/user/pouzzler/media/kivy_zpscf0e6c6e.png.html?sort=3&o=0 - and these artifacts have extended to a preexisting program, probably not written with kivy: the Faster Than Light game.

I don't know if both issues are related or not.

Mathieu Virbel

unread,
Jan 18, 2013, 9:26:03 AM1/18/13
to kivy-...@googlegroups.com
Hi,

You have buggy drivers :)
Transparent images works, check the demo, the logo backrgound is transparent, as well as all the images used in the widgets (sliders, button etc.). So i guess it's something about your code, or your images, or your buggy drivers.

Regards,

Mathieu




Le 18 janv. 2013 à 14:55, Magnien Sebastien <s.ma...@gmail.com> a écrit :

> I forgot to mention that Kivy corrupted something on my system: I noticed when running the hello world sample that curious artifacts appeared in its title bar, and in unity launcher (ubuntu 12.04 + ppa:xorg-egers for sandy bridge compatibility) - http://s1341.beta.photobucket.com/user/pouzzler/media/kivy_zpscf0e6c6e.png.html?sort=3&o=0 - and these artifacts have extended to a preexisting program, probably not written with kivy: the Faster Than Light game.
>
> I don't know if both issues are related or not.
>
> --
>
>

Magnien Sebastien

unread,
Jan 18, 2013, 9:43:28 AM1/18/13
to kivy-...@googlegroups.com
Hello Mathieu, thank you for your answer.

It couldn't be the code, except if there is a different way to load a transparent png than a non-transparent one, that I failed to notice. Without touching the code, just changing the png, one is displayed, while the other isn't.
It can't be the images, as I am able to load the same transparent png with mono, qt, and android test-apps. However Kivy seems the easiest framework to code for, with good multi-platform capabilities, I really wish I could go on with it.
Lastly, I have absolutely no knowledge in drivers or driver code, yet it seems a little far fetched that these pngs display perfectly everywhere (the Gimp, three different test-apps in three different languages), except in the Kivy app, and that it would be somehow related to the drivers.

Do you have any other pointers, or a more in-depth explanation of how it might be a driver issue, and how I might correct it?

Best regards,
Sébastien

Magnien Sebastien

unread,
Jan 18, 2013, 10:03:41 AM1/18/13
to kivy-...@googlegroups.com

I have made one further test:

from Tkinter import *
import ImageTk

t = Tk()

frame = Frame(t)
frame.pack()

canvas = Canvas(frame, bg="white", width=500, height=500)
canvas.pack()

photoimage = ImageTk.PhotoImage(file="Nand.png")
canvas.create_image(100, 100, image=photoimage)

t.mainloop()

This python code shows the image as intended. Hoping we solve this difficulty, Kivy really looks like an interesting kit.
Best regards,
Sébastien


Gabriel Pettier

unread,
Jan 18, 2013, 10:11:38 AM1/18/13
to kivy-...@googlegroups.com
Kivy uses opengl for everything, as opposed to more traditional ui
frameworks, so your GPU and drivers have a lot of influence. The fact
that starting kivy corrupt your UI is an indication of buggy drivers
(and you use an unstable driver, so more prone to bugs). If transparency
doesn't work for you, it may be because of such bug. There is no
difference in the loading of transparent and non-transparent images from
user side in kivy, so unless you did something very wrong (but again,
you can check in the examples if you have the same issue with
transparent images in them), the error has more chance to come from your
driver than from your code.

cordially.

Le 18/01/2013 16:03, Magnien Sebastien a �crit :
> S�bastien
>
>
> --
>
>

Magnien Sebastien

unread,
Jan 18, 2013, 10:25:49 AM1/18/13
to kivy-...@googlegroups.com
Ah thanks, this almost made me understand the issue, and since my PC just won't work correctly without these drivers, I suppose I'll have to wait until they make it to the main ubuntu before using Kivy. 

Thank you both, and best regards


Thomas Hansen

unread,
Jan 18, 2013, 10:28:57 AM1/18/13
to kivy-...@googlegroups.com
Do you know what kind of graphics card you have?  And what version of ununtu you are running?  


On Friday, January 18, 2013, Magnien Sebastien wrote:
Ah thanks, this almost made me understand the issue, and since my PC just won't work correctly without these drivers, I suppose I'll have to wait until they make it to the main ubuntu before using Kivy. 

Thank you both, and best regards


--
 
 

Magnien Sebastien

unread,
Jan 18, 2013, 12:55:02 PM1/18/13
to kivy-...@googlegroups.com
I have an Asus UX31-A notebook coming with an Intel HD4000, under Ubuntu 12.04. In order for most things to work correctly, the ppa:xorg-edgers is/was needed, and I have no inclination to test package by package, I'll just lay low on Kivy until such a time as the ppa ain't needed anymore because it has made it into main ubuntu. Maybe I should try 12.10, but I'd hate to break something.
Reply all
Reply to author
Forward
0 new messages