Hacker News new | ask | show | jobs
Show HN: Extract code from image snippets with Code OCR App (code-ocr-app.vercel.app)
2 points by rifkyniyas 1057 days ago
Hi folks, ever found an interesting code snippet online and ended up manually typing it all out? Frustrating indeed. So I decided to make the Code OCR App. You can now extract the code from any image snippet with just three clicks. 1- Upload your desired file 2- Crop and adjust the image to include only the desired text portion. 3- Once extracted, simply copy and start using in your project right away!

The text extraction is currently powered by tesseract.js so there might be inaccuracies in the extracted text. There are few other limitations as well which I am working on for a fix.

Check out the app and do let me know of your thoughts. Your feedbacks are highly appreciated.

1 comments

that's a really cool use of tesseract.

one problem: the cropping cut off half the code sample I uploaded. not sure if that was due to the size of the image, the app didn't explain, but if cropping is not require don't require, if it is required explain why.

I did not realize there was a lot of code trapped in images either, it seems like there is a lot of formatted code support as raw text

Thank you for the feedback and I am looking into the issues you mentioned.

Talking about the first issue, at the moment it is required for all images to be manually cropped to fit only the required part of code to be extracted to improve the accuracy of extracted code (since it get rids of unnecessary file names and numbers if present on image). I think I can provide a better user experience by emphasizing this better. Just to confirm, did you adjust the crop to fit only the required parts or did you cropped with the initial state? If it's the latter, I think tesseract extracted the incorrectly cropped version of image.

My pardons, I didn't get a clear idea of the second issue. Can you elaborate more in to that please? Do you mean any issues with the code formatting/ highlighting?