How to get the attributes of an image or text

Asked by Mohmyda

Hi,

Once I find(Image/Text), I want to get its attributes like

Font family, Font colour/Image colour, if it is underlined or not. If underlined what the pixel rate of the line.

More over, I need to read the text present in the webedit controls and find the width of it.

If the above things are possible, please let me know the way of doing it.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

not possible in the current version.

Revision history for this message
Mohmyda (mohana-kandaswamy) said :
#2

Can this be acheived by any work around using python. (i.e. Using any of the python packages)

Revision history for this message
Mohmyda (mohana-kandaswamy) said :
#3

Can you please tell me why is it not possible?

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Why not possible?
because Sikuli in the moment does not have any features like OCR. It is only;-) a "pixel by pixel comparison tool" without knowing anything about the interpreted content of a visual object.

Workaround using Python?
There are packages available. Some people have tried to use them (search for according questions using OCR). The challenge is, to make them available: https://answers.launchpad.net/sikuli/+faq/1110.

Some ideas (if not too complicated):
- use copy/paste to get your text to the clipboard (http://sikuli.org/blog/2010/05/06/extract-text-with-clipboard/). In some app paste your text and give it the relevant attributes. Use capture and create a Finder object where you compare with your sample text (I guess you have to play with similarity).

- use a magnifier feature and get a capture of to or three magnified characters, that you can compare with some samples.

Can you help with this problem?

Provide an answer of your own, or ask Mohmyda for more information if necessary.

To post a message you must log in.