SikuliX1 icon indicating copy to clipboard operation
SikuliX1 copied to clipboard

Linux: Lubuntu 18: highlight rectangle is black - should be transparent

Open RaiMan opened this issue 5 years ago • 12 comments

Launchpad question

noticed that in the old versions highlight rectangle was 100% transparent, but now on Windows 10 and Ubuntu 18 rectangle has red-ish filling. I believe this is the reason on Lubuntu18 highlight is showing as a black rectangle. I know that this is not a critical problem and I can use Ubuntu, but reason for me to use Lubuntu is that it is very light on system resources in comparison with Ubuntu. So is there a way to configure Sikuli 2.0 to use the old way of highlighting?

RaiMan avatar Oct 25 '19 08:10 RaiMan

This is also happening for me in Windows 10 with version 2.0.1 We use SikuliX for demo automation and screen recording. The red-ish background is a no-go for us at the moment.

MiguelDomingues avatar Nov 29 '19 09:11 MiguelDomingues

@MiguelDomingues What exactlyx do you mean by This is also happening for me in Windows 10 ?

RaiMan avatar Dec 02 '19 17:12 RaiMan

Sorry for not being specific. What I have is this "noticed that in the old versions highlight rectangle was 100% transparent, but now on Windows 10 and Ubuntu 18 rectangle has red-ish filling"

See picture below: image

The script is this

pattern = find(Pattern("1575322297453.png").similar(0.70))
pattern.highlightOn()
wait(2)
pattern.highlightOff()

I just tested this with the master branch code.

MiguelDomingues avatar Dec 02 '19 21:12 MiguelDomingues

I did a bit of digging, and submitted a Pull Request: https://github.com/RaiMan/SikuliX1/pull/250 That fixed for me.

MiguelDomingues avatar Dec 02 '19 22:12 MiguelDomingues

@MiguelDomingues As mentioned with the PR: not the colored fill-in is the original problem, but the solid black background only on Lubuntu.

RaiMan avatar Dec 03 '19 08:12 RaiMan

I asked the original complainant on Launchpad, to test the new feature (switch off color fill-in): https://github.com/RaiMan/SikuliX1/commit/0e5a5786d7a5ee134586da9a5957928c0018902f

RaiMan avatar Dec 03 '19 08:12 RaiMan

I done the test on build 466 from 5 Dec 2019

Settings.HighlightTransparent=True
find(someimage.jpg).highlight(2)

On Windows10: PASS - highlight box is 100% transparent On Lubuntu18: FAIL - highlight box is still black

Note: I noticed that default value of Settings.HighlightTransparen is False for Windows and True for Lubuntu

ndinev avatar Dec 05 '19 15:12 ndinev

In version 1.1.4 I had a different behavior. In that version the background was always transparent. That's why I believed it was a bug. I was unaware of that setting also.

MiguelDomingues avatar Dec 06 '19 08:12 MiguelDomingues

@ndinev thanks for the feedback. So it seems the reddish fill-in is not the problem (but the intended new behaviour ;-). I will go back and use the complete implementation of 1.1.4 in case of Settings.HighlightTransparent=true

I will report here, when it is ready to test.

RaiMan avatar Dec 06 '19 09:12 RaiMan

Since I am testing new Sikuli 2.04 on different OSes I found what is causing this problem. It happens on system that does not have enabled/installed composition manager. It can be easily reproduced-fixed on latest Lubuntu 20 LTS. You just need to go to Preferences->LXQt Settings->Session settings. In the Basic settings you can see that Compton(Composition manager) is off by default. If you turn it on Sikuli highlight will work as expected. However the UI will become slower and this is not desirable. Despite this findings I believe that highlight should be able to work without the need of heavy composition manager because this will require more resources for test machines.

ndinev avatar Apr 27 '20 15:04 ndinev

@ndinev Is this also the case, if you have Settings.HighlightTransparent=true ???

which will only put a simple bordered JFrame with transparent background on the screen.

IMHO there is no simpler solution at the Java level (system independent) .

RaiMan avatar Apr 28 '20 08:04 RaiMan

On Ubuntu 20.04 LTS, I can confirm that using

Settings.HighlightTransparent = True

somewhere in a script with SikluliX 2.04, does render the highlight as an outline only, and removes the black fill bug.

To keep the gradient fill on Linux, you must set Settings.HighlightTransparent to False once, and then set it to True again, which should remove the black fill bug. This does not seem to be affected by Compton (at least, not consistently anyways).

andrewjmetzger avatar Jun 18 '20 23:06 andrewjmetzger