Extract text from image

I want to extract text from an image which is received in an email. Any tips on how I can go about it?
Which tool can I use to extract text from the image received as an email.

Thank you.

Hello @User1111 nice to meet you.

If you want to extract text from image you can try tools like PDF.co or 0CodeKit.

Don’t hesitate to contact us if you require further assistance.

//VLAD

3 Likes

I tried PDF.co before posting the query here. I used “Parse a document” option for PDF.co but that didn’t work since it’s expecting a pdf document as input.
For 0CodeKit, which option do I select to extract the text?

You can use these apps/modules:

OpenAI “Analyze Image(s) - Vision”

0CodeKit “Detect Text in a Picture with OCR AI”


Example image used:

https://jeroen.github.io/images/testocr.png

2 Likes

The image is in the email. What value do I enter in “Image URL” for 0CodeKit.

I have tried giving ‘HTMLContent’, ‘TextContent’ but I keep getting errors.

Welcome to the Make community!

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Looks like the image cid:ii_lq10gjci0 (Content ID) is located in the attachments parameter in your email.

You simply need to use the module “Iterate Attachments” and filter the images, something like this

2 Likes

What value do I enter for Image URL?

You can upload the image to a publically accessible URL first.

E.g.: Upload to Google Drive and Get Share Link

Alternatively, you can use the OpenAI Vision module, which allows direct upload of image file data

2 Likes

I was trying to upload the image to google drive and then pass the link to 0CodeKit but I get an error

When I click on the link, I am able to view the image.


I prefer this option compared to OpenAI as using OpenAI would be more costly.

Please provide the output bundles of the modules [19] by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

googledrive.json (4.4 KB)
Attached.

I think you have to use webContentLink instead of webViewLink.

Also, please ensure that you have already used the Google Drive “Get Share Link” module to make this file available publically.

2 Likes

I had tried with webContentLink before I used webViewLink.

webContentLink is for downloading the file.

Error screenshot attached for reference.

Looks like can’t use 0CodeKit for this case?

I managed to get it to work with an inline image attachment from an email in Gmail.

Scenario

Using “Web Content Link”, like I mentioned:

Output

Screenshot_2023-12-14_101206 (2)


Without having access to your original email, I’m unable to assist further.

2 Likes

Can you share the output bundle from each of the modules so that I can compare with mine.

Thank you.

No, please share your “Web Content Link” URL here, or forward the email to me.

This is the output from the "Share a link " module

[
{
“kind”: “drive#permission”,
“id”: “04400411415080ZZZZ”,
“type”: “user”,
“emailAddress”: “XXXXX@gmail.com”,
“role”: “owner”,
“displayName”: “XXXXX”,
“photoLink”: “https://lh3.googleusercontent.com/a/default-user=XXX”,
“deleted”: false,
“pendingOwner”: false,
“shareLink”: “https://drive.google.com/file/d/ZZZZ
}
]

“ShareLink” is what is passed to 0CodeKit.
When I click on url in the sharelink, I can download the image.
But still getting the same error.

What’s the need for “iterate attachments” module? I can upload the image file (.jpeg) to my google drive without this module too.

Here’s what your “Get a share link” module should look like

Screenshot_2023-12-14_161257

You did not set your fields correctly, I even showed you a screenshot of the settings here

2 Likes