How to get text from a graphic image
Tony Dietrich
td at transoft.demon.co.uk
Sat Feb 19 22:58:22 UTC 2005
On Saturday 19 Feb 2005 22:33, Mercury Morris wrote:
> I took a screen snapshot (ksnapshot) of a terminal window
> with some text in it. I wasn't able to get the text to be copied
> to the clipboard for pasting into an editor window.
>
> Now, I have a record of the text, in an image, and I can go back
> and review it for testing/debugging/etc.
>
> My question: How do I NOW get the text from the image?
> It's a .jpg (snapshot2.jpg). I tried GIMP, but the learning
> curve is way too long and steep. What is a way to get the
> text out of the image file?
>
> Thanks for any short, simple solution you might know.
>
> --
> MM
Can you repeat the command you are trying to get the result from?
If so, go and take a look at the redirection options in bash or whatever shell
you are running.
Output from a command (either standard output, or standard error) can be
redirected to a file.
In most cases if all you want is the standard output from a command logged
into a file then
#command > file.name
will work for you.
If you want both the standard output and the error output from a command
#command 2>&1 > file.name
should work.
Note that by default the noclobber variable in the shell is set, so the
redirection symbol > will not overwrite a file that exists already.
Either delete the file first, or append the new data to the end of the file by
using the >> symbol instead.
YMMV
If you cannot repeat the command, then the only option to convert the image
text to a pure text file is to use Optical Character Recognition (OCR)
programs. Thats not my field I'm afriad, but google might help you out
there.
A quick search found this site :
http://www.linux-ocr.ekitap.gen.tr/en/
It would appear that most of the software needs a .pbm file to work with, but
conversion from jpeg to pbm is pretty simple.
HTH
--
Tony Dietrich
-------------
Martin was probably ripping them off. That's some family, isn't it?
Incest, prostitution, fanaticism, software.
-- Charles Willeford, "Miami Blues"
More information about the fedora-list
mailing list