Trying to use Import, GIMP, and Tesseract to read english text from screenshot of dialog
David M. Karr
davidmichaelkarr at gmail.com
Mon Apr 13 00:10:56 UTC 2009
I'm trying to follow the documented procedures (that I can find) to take
a screenshot of a dialog that contains some text in it, then use an OCR
reader to extract the text from that dialog.
My test case for now uses "import" to take the screenshot (a list of
installed packages in Eclipse), then GIMP to save as TIF, then Tesseract
to read the text.
After using "import" to save as a PNG file, I then followed the
instructions at <https://help.ubuntu.com/community/OCR> to save an image
that Tesseract can use. There was a problem with these steps, however.
The steps are the following:
1. Go to the Image→Mode menu and make sure the image is in RGB or
Grayscale mode.
2. Select from the menu Tools→Color Tools→Threshold and choose an
adequate threshold value.
3. Select from the menu Image→Mode→Indexed and from the options choose
1-bit and no dithering.
4. Save the image in TIFF format.
On step 1, it was in RGB. On to step 2.
On step 2, I went to the Threshold dialog, but what the heck is an
"adequate threshold value"? I cancelled the dialog, as I had no idea
what to do there.
On step 3, that appeared to work.
On step 4, I got the following dialog:
-------------
Your image should be exported before it
can be saved as TIFF for the following
reasons:
TIFF plug-in can't handle layer offsets, size or opacity
Merge Visible Layers
The export conversion won't modify your original image.
----------------
So, I tried clicking "Export" at this point.
On the next dialog, labeled "Save as TIFF", I selected "None" for
Compression.
When I clicked OK, it gave me a dialog saying this:
---------------------
GIMP Message
Saving '/home/...' failed:
TIFF save cannot handle indexed images with alpha channel.
-------------------------
I don't know how to proceed with this.
More information about the ubuntu-users
mailing list