Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sikuli and Images with a Transparant background

Tags:

sikuli

I am trying to test things out lately with Sikuli and the use of an Image with a Transparant background.

For example with the Sikuli IDE we define:

Image_FireFox = ("FireFox.png")

Now I took that "FireFox.png" and I have adjusted it with Paint.NET to make the background transparant. And then I save it again to "FireFox.png", and I put the new .png in the map of where Sikuli orginaly placed it.

When I open the IDE again, that image appears to have a black background (and not transparant). And also the image is not recognized anymore by my Sikuli Script. If I open the image in Windows Viewer, the background is still transparant.

The idea behind it is to make the image better recognized, and then my script would not care if the background of the FireFox icon is white, red or whatever colour.

Does anyone know if there is a way that Sikuli can deal with images with a transparant background? So that finding an icon on the desktop goes better, and the background wouldn't matter anymore.

like image 690
Tenzin Avatar asked Dec 03 '25 01:12

Tenzin


1 Answers

Sikuli (or should I say OpenCV core that's being used by it), does not care about the background of the image itself. What it does is just to scan the whole screen as it is, exactly as it appears to you. It is not aware of types of images or anything else, just pure visual appearance. Saying that, if your image remains unchanged since when you first created the pattern and you can uniquely detect it on the screen, that will work.

As far as I understand, this quite the opposite of what you're trying to do. Do not try to change the image background because if you do, everything that will become visible behind this image (due to transparency) will prevent Sikuli from detecting it rather than helping it. Keep in mind that Sikuli only deals with rectangular patterns, so anything which is other than rectangular image won't work.

In regards to the way it looks in IDE, I'm not sure. That might be as a result of not supporting images with transparent alpha channel. You can try and ask this question on Sikuli official forum here.

like image 134
Eugene S Avatar answered Dec 05 '25 22:12

Eugene S