Identify the Color of an Image

M

Monyl

Hi,

1. How can I find the color of an image present the webpage?

2. How to identify the font type of the selected text present in the
content of the web page

It would be much helpfull, if anyone responds to it ASAP

Thanks
Mohmyda
 
G

Gary Herron

Hi,

1. How can I find the color of an image present the webpage?

2. How to identify the font type of the selected text present in the
content of the web page

It would be much helpfull, if anyone responds to it ASAP

Thanks
Mohmyda



Please be clearer about what you want.

1. An image does not "have" a color, although each pixel in an image
does have a color.

2. Text in a web page does not (necessarily) have a font, although the
display engine will use a font of its choice to render text. And my
browser will probably use a different font than yours.
 
J

John Nagle

Hi,

1. How can I find the color of an image present the webpage?

2. How to identify the font type of the selected text present in the
content of the web page

It would be much helpfull, if anyone responds to it ASAP

Thanks
Mohmyda

"Selected text"? Selected how? "Selected" implies some form
of user interface, like a browser. If you're doing something in
a browser, look into Firefox and Greasemonkey.

John Nagle
 
M

Monyl

     "Selected text"?  Selected how?  "Selected" implies some form
of user interface, like a browser.  If you're doing something in
a browser, look into Firefox and Greasemonkey.

                                John Nagle

I will be using a automation tool called Sikuli and select the text or
an Image.

My Requirement
---------------

I will capture the image manually and scriptify using Sikuli. To find
the captured image in the web page. Once it finds the image I need to
collect the information of the image like,

Co-ordinates of the image, height and width, color and pixel rate of
the image.

If I want to search a particular text in a webpage. I need to find the
font name, type, color and size of the text.

Note :- We can open the web page in any browser. but I should be able
to capture the attributes of the image/Text displayed.
 
M

Monyl

Please be clearer about what you want.

1. Animagedoes not "have" acolor, although each pixel in animage
does have acolor.

2.  Text in a web page does not (necessarily)  have a font, although the
display engine will use a font of its choice to render text.  And my
browser will probably use a different font than yours.

Hi Gary Herron,

1.If I am going to click on a particular image. I will have click
using the co-ordinates of an Image. Can we find the color of the pixel
which lies in that particular co-ordinate where I click.

2.I just want to retrive the attributes of the text as it appears on
the browser. Can I get the font value depending on the browsers.

Hope you understand my problem.
 
D

Dennis Lee Bieber

I will capture the image manually and scriptify using Sikuli. To find
the captured image in the web page. Once it finds the image I need to
collect the information of the image like,

Co-ordinates of the image, height and width, color and pixel rate of
the image.
Images only have coordinates WHEN RENDERED BY a browser... And those
coordinates will change if the browser changes size, or font size, etc.

Height and Width may be whatever the image file contained, OR
whatever was defined in an IMG tag if the browser has the ability to
scale images during rendering. "color and pixel rate" don't make any
sense... GIF format files use a look-up table of 256 colors, and the
"pixels" consist of 8-bit index values into that look-up table.

Normally image /references/ will be found by parsing the HTML for
<IMG ...> tags, then finding the SRC attribute and extracting the URL of
the image file... Retrieving the image file is a separate step from
retrieving the main HTML... This presumes you don't want to also find
images tiled as a background, as those are specified in different tags.
If I want to search a particular text in a webpage. I need to find the
font name, type, color and size of the text.
Again dependent upon the browser... I can set my browser to ignore
any font specifications in the HTML and use just a font I choose... Or
let it use which ever is available on my machine from a list it
specifies as metadata.
Note :- We can open the web page in any browser. but I should be able
to capture the attributes of the image/Text displayed.

Does the browser support access from external programs? Then you are
probably looking at accessing the DOM data structure the browser uses
internally.
 
T

Thomas Jollans

Hi Gary Herron,

1.If I am going to click on a particular image. I will have click
using the co-ordinates of an Image. Can we find the color of the pixel
which lies in that particular co-ordinate where I click.

You haven't even told us which platform you're talking about.

This is a highly platform specific problem.
2.I just want to retrive the attributes of the text as it appears on
the browser. Can I get the font value depending on the browsers.

If you want to know which font a browser is using to render something,
you'll have to, essentially, ask the browser!

I doubt this is something any browser would support, as it's hard to
imagine *any* practical use case. Should be possible by extending
firefox. (or any open source browser)
Hope you understand my problem.

Not really.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top