Uploading image to a website and getting data from it

Ok, this could sound complicated (and maybe it is). So, what I would like to do (if it’s even possible) is uploading an image made with screenshot-basic, to an existing website that you can find online, that retrieves text from the image. I thought about sending a PerformHttpRequest with data on it but I couldn’t imagine how to do that.

If this sounds possible, any ideas of how I could make this?

If I understand correctly client A takes a screenshot, that’s sent to a server endpoint that retrieves text from an image, then what happens at that point?

I think that’s going to be the determining factor as to how you want to do it. If it’s something you’re just going to log, I’d recommend just sending that image to your own servers (maybe via webhook) and then from there doing the processing. If it’s needed on the server live, then I’d say it becomes a little more complex, because you have to account for the potential load you’re placing on the service and the latency it may include.

What do you mean server endpoint :sweat_smile: ? You mean server side script?

After getting the text from the image, I would like to make a condition that checks if the text includes some specific words. If it does then it logs the screenshot otherwise it doesn’t. I would be able to do this but I don’t know how to get the text from the image . As I mentioned before I thought of doing this with PerformHttpRequest but… how?

When I say server endpoint, I mean like to a website to have it processed. So I guess what I was recommending would be you setting up a web server that would do the work for you, but it seems like that’s out of the picture?

Ok, then server endpoint should be a solution. As long as it gets the text from the image and it returns it back to the lua script then it’s fine. How the code would look like? If you could make a really quick example of the code it would be great

Ok, it seems I found a solution for the getting text from an image. Instead of the performhttprequest that I thought about, i found a JavaScript library that can do this. https://tesseract.projectnaptha.com/. After that I get the text from JavaScript I send it to a nui callback to lua and that’s it.

@momof513 , thanks for helping anyway .

1 Like