473,385 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

css to annotate image files?


dear css experts:

I have some TIFF images of text articles. I would love to be able to
use the "Find" feature in my browser to a particular word in the text,
and to have hrefs in the document be clickable. Acrobat Acrobat can do
this for pdf documents, but I would love to stick to tiff or gif or
some other plain browser format. my OCR software gives me the exact
location of each word, so I have the raw information necessary.

now, css can render this as invisible text above the image (in an
absolute location). I presume (but have not yet tried) that a find
would still be visible to the browser user, because the found text
would be rendered. I would love to have the ability to render a
semi-transparent block in css, so that I can highlight clickable area
in the underlying image, too, but I think this is not possible.

I guess my question is if anyone has written a program that automates
this "making bitmaps searchable" using CSS?

/iaw

Dec 23 '06 #1
5 2323

iv****@gmail.com wrote:
I guess my question is if anyone has written a program that automates
this "making bitmaps searchable" using CSS?
I'd be wary of this for web use. Search engine spiders don't like
invisible content and regard it as spamdexing, penalising it as such.
If you do it, then make the stuff visible (although not prominent) to
non-JS users, then only "hide" it with a bit of JS at page load time.
You can certainly use CSS and standard :hover or clickable button
techniques to make it appear. Two caveats though: if this stuff is
worth seeing, then it's usually more annoying to have it on hover only.
Maybe I really do want to read the stuff. Secondly it ought to appear
when printed, when better accessibility is needed, or when I've
manually selected to show everything (and that should be persistent for
at least my session).

When I do image galleries I embed the metadata inside the image (JPG
EXIF) and then extract it into the HTML automatically. I also use a lot
of Dublin Core to structure it, but not the more obscure formats like
MPEG-7. I don't do much CSS on top of this.

Dec 27 '06 #2

hi andy: thanks for the advice. fortunately, search engine inclusion
is not important to me. I am just trying to add the ability to
"search=find" (OCR-equivalent) text in image-files of articles. The
user will see the true authentic representation of the text in the
image itself.

This seems to be harder to do than I thought. I can't even get a
simple "proof of concept" to work. sigh...

regards,

/iaw

Dec 28 '06 #3

iv****@gmail.com wrote:
I am just trying to add the ability to
"search=find" (OCR-equivalent) text in image-files of articles.
Seems like the images alt text is what you need, or maybe even look at
using longdesc.

You'll have to process the HTML a bit though, either before publishing
(XSLT might be handy) or with some client-side JS.

Dec 29 '06 #4
iv****@gmail.com a écrit :
[...] I am just trying to add the ability to
"search=find" (OCR-equivalent) text in image-files of articles. The
user will see the true authentic representation of the text in the
image itself.
A possible start would be:
* create a div of fixed width and height (in pixels)
* set the image as background of that div
* split the recognized text in words, or possibly in lines, create one
span per unit and position it inside the div
(using lines instead of words as unit allows the search to span
several words)

But then a simple proof of concept shows that a lot of information is
missing: do you have any way to obtain the font used in the image? How
can you make sure the end user has the same font installed, or allows
text to be as small as the text in the image?

I would go another route:
* create a div as above
* put the image in it
* write a simple FORM that lets the user enter search pattern
* write the server side code that, given that search pattern,
find all the matches and, for each match, computes a rectangle
framing the matching text, then creates a span inside the outer
div (simple border, no background to let the text shine through)
* when this is working, add some Ajax "magic" for interactivity.

Good luck!
--
Daniel Déchelotte
http://yo.dan.free.fr/
Dec 29 '06 #5

hi daniel:

the best analogy may be the desire to display a NYTimes front page
image, and allow a user to search for text on this page.

your first suggestion is also what I was thinking of, but the remaining
issue is how I can make the foreground words invisible, except that I
need at least a colored box when selected.

I value speed and convenience [using ordinary browser mechanisms] over
perfect alignment accuracy or even multi-word searches. I can also
assume that my users have the basic microsoft web fonts. at least on a
word-by-word basis, I can make sure that I won't be off too much. In
fact, I would even be happy to display an arrow where the searched for
word starts---the point is to allow the reader to find a word on a long
image page.

I have never used ajax. maybe I need to learn it to do something like
this, though.

Andy---any alt tags on images are not searchable, and even if they
were, they would not show the reader where a particular word starts.

regards,

/iaw
Daniel Déchelotte wrote:
iv****@gmail.com a écrit :
[...] I am just trying to add the ability to
"search=find" (OCR-equivalent) text in image-files of articles. The
user will see the true authentic representation of the text in the
image itself.

A possible start would be:
* create a div of fixed width and height (in pixels)
* set the image as background of that div
* split the recognized text in words, or possibly in lines, create one
span per unit and position it inside the div
(using lines instead of words as unit allows the search to span
several words)

But then a simple proof of concept shows that a lot of information is
missing: do you have any way to obtain the font used in the image? How
can you make sure the end user has the same font installed, or allows
text to be as small as the text in the image?

I would go another route:
* create a div as above
* put the image in it
* write a simple FORM that lets the user enter search pattern
* write the server side code that, given that search pattern,
find all the matches and, for each match, computes a rectangle
framing the matching text, then creates a span inside the outer
div (simple border, no background to let the text shine through)
* when this is working, add some Ajax "magic" for interactivity.

Good luck!
--
Daniel Déchelotte
http://yo.dan.free.fr/
Dec 29 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
1
by: D. Yates | last post by:
Hi, I am looking for an example of how to extract bitmap images from an embedded resource file (a file with *.res extension, which can be viewed inside of the ide and can hold bitmaps, icons,...
35
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
4
by: escristian | last post by:
Hello. I'm trying to create an Image so I use something like this: Image newImage = Image.FromFile(filename); Now when it's a bmp file and certain .gif files it gives me an exception that...
1
by: antony | last post by:
It run w/o error but no image appears. Please help me. Here si the code I do " <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page...
5
by: John Baima | last post by:
I need to annotate a large store floor plan. I have the floor plans as images, and I was wondering if there is any software available which would allow me to quickly and easily create hot-spots and...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
1
by: =?Utf-8?B?Um9iZXJ0IFNsYW5leQ==?= | last post by:
Is there a way to annotate the state transition in the designer for VS2005/8. I have tried setting the description property for both the EventDriveActivity and SetStateActivity shapes but nothing...
2
by: kelvinwebdesigner | last post by:
Hi everybody. Im currently developing an application where users can upload files and later get acess to the url. Im now having this trouble with header Cannot modify header information – headers...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.