How I can eject the text I have been draw in image?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
RogerAFH
Posts: 5
Joined: 2016-05-05T07:15:41-07:00
Authentication code: 1151

How I can eject the text I have been draw in image?

Post by RogerAFH »

Someone has already drew(or annotated) a lot words on an image with IM, but now I need to eject these words into a text.
How I can eject these words with IM? Is there any way to do this? I cannot find any useful information in documents and I would like to express my gratitude to whom can help me solved this problem.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How I can eject the text I have been draw in image?

Post by fmw42 »

What is your IM version and platform? Always provide that information with questions, since syntax may differ. Can you post an example image for us to understand your problem better. You can upload to some free hosting service such as dropbox.com and put the URL here.

If the text is all the same color and that color differs from the rest of the image, then you can make the rest of the image transparent using something like:

Code: Select all

convert image -fuzz XX% +transparent your_text_color result
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How I can eject the text I have been draw in image?

Post by snibgo »

RogerAFH wrote:How I can eject these words with IM?
I don't understand what you want.

Perhaps you have an image that contains text (as pixels in the image), and you want to convert this back into text that can be pasted as characters into a document. That process is called OCR (Optical Character Recognition). ImageMagick can't do OCR. For OCR, use software such as Tesseract.
snibgo's IM pages: im.snibgo.com
RogerAFH
Posts: 5
Joined: 2016-05-05T07:15:41-07:00
Authentication code: 1151

Re: How I can eject the text I have been draw in image?

Post by RogerAFH »

fmw42 wrote:What is your IM version and platform? Always provide that information with questions, since syntax may differ. Can you post an example image for us to understand your problem better. You can upload to some free hosting service such as dropbox.com and put the URL here.

If the text is all the same color and that color differs from the rest of the image, then you can make the rest of the image transparent using something like:

Code: Select all

convert image -fuzz XX% +transparent your_text_color result
I'm sorry that I post an ambiguous question.
My IM version is Version: ImageMagick 6.9.2-7 Q16 x86_64 2015-12-06.
Image http://pic.fdzh.org/uploads/2016/05/Scr ... _09_38.png
This is a little cut of the image, and the red or blue words are my friend annotated. His use only IM to annotate these words and I want to find a way to print these words as text. I think these words are annotation and is there any way to find out them?
Thank you very much!
RogerAFH
Posts: 5
Joined: 2016-05-05T07:15:41-07:00
Authentication code: 1151

Re: How I can eject the text I have been draw in image?

Post by RogerAFH »

snibgo wrote:
RogerAFH wrote:How I can eject these words with IM?
I don't understand what you want.

Perhaps you have an image that contains text (as pixels in the image), and you want to convert this back into text that can be pasted as characters into a document. That process is called OCR (Optical Character Recognition). ImageMagick can't do OCR. For OCR, use software such as Tesseract.
Image
It is a question that post on a web.
I used to think it is an OCR problem but I was told the image author eject these words(name with red,blue color) for this image only using IM. Is IM keep the words imformation(annotated or drew) when we annotating these words on image? I just want to find these words out.
Thank you very much!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How I can eject the text I have been draw in image?

Post by fmw42 »

Once text is put into an image, it is no longer text but raster data. You would have to remove all the background except for say red using the command I mentioned above, then make the image black for the text and white for the background. Then you would have to use OCR to convert the image to ascii text, so that it can be read as text. Imagemagick can do the former, but it does not do OCR. You would need some tool such as Tesseract to convert the data to ascii text.

IM does not keep the textual words as words once the image is created, unless the user specifies that it should also be written to the meta data of the image as a comment or label.

You can check for that using the original images (not the screen shot) by:

Code: Select all

convert image -format "%c" info:
or

Code: Select all

convert image -format "%l" info:
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How I can eject the text I have been draw in image?

Post by snibgo »

The image you provide is a screenshot, which is the pixels as shown on a screen. If any software wrote annotation in the metadata of the original image, it won't appear on the screenshot.
snibgo's IM pages: im.snibgo.com
RogerAFH
Posts: 5
Joined: 2016-05-05T07:15:41-07:00
Authentication code: 1151

Re: How I can eject the text I have been draw in image?

Post by RogerAFH »

snibgo wrote:The image you provide is a screenshot, which is the pixels as shown on a screen. If any software wrote annotation in the metadata of the original image, it won't appear on the screenshot.
The image I show is just a part of the image because the image is too large.
RogerAFH
Posts: 5
Joined: 2016-05-05T07:15:41-07:00
Authentication code: 1151

Re: How I can eject the text I have been draw in image?

Post by RogerAFH »

fmw42 wrote:Once text is put into an image, it is no longer text but raster data. You would have to remove all the background except for say red using the command I mentioned above, then make the image black for the text and white for the background. Then you would have to use OCR to convert the image to ascii text, so that it can be read as text. Imagemagick can do the former, but it does not do OCR. You would need some tool such as Tesseract to convert the data to ascii text.

IM does not keep the textual words as words once the image is created, unless the user specifies that it should also be written to the meta data of the image as a comment or label.

You can check for that using the original images (not the screen shot) by:

Code: Select all

convert image -format "%c" info:
or

Code: Select all

convert image -format "%l" info:
Thanks~~ :)
Post Reply