[request] image files having a transparent background should be supported somehow
Bug #1306396 reported by
RaiMan
This bug report is a duplicate of:
Bug #673995: [request] Transparent pixels should be ignored in matching process.
Edit
Remove
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
In Progress
|
Medium
|
RaiMan |
Bug Description
from https:/
The other issue I run into when grabbing images from products or source trees is that png's can (and often do) have transparent backgrounds. You can convert those to jpeg's and back to png's using sips, but they end up with a white background. If someone has a Mac solution, without having to use ImageMagick or something else to be downloaded, I'd be grateful for a solution.
To post a comment you must log in.
Currently the only solution/workaround is to crop the image, so that the remaining transparent pixels are reduced to a minimum (concentrate on the key visual aspects being opaque).
The current implementation based on the OpenCV feature matchTemplate does not allow images having a transparency channel - only the 3 RGB channels being taken as opaque.
So transparency information is simply ignored on the way from the given image to the OpenCV Mat object.
BTW: with Sikuli it is a best practice anyway, to take care, that an image contains as little background as possible, thus concentrating on the key visuals of the image. The more even background, the lower the resulting similarity can be.