Image Processing in Front End with Python?

Hello! I would very much like to use some python code I have written within my app. Is this possible, or must it be within the backend on a server?

Newbie to web dev here, so take this with a gain of salt. My understanding is that it would require a Python to JS transpiler, which do exist I think but I’m not sure they’re often used in reality. I stumbled upon Skulpt which may get you where you’d like? It’s unclear to me whether this would get you a production grade service or if you’re going to be able to use a module like openCV in it, but it seems neat anyway.

1 Like

JavaScript is the only code that runs in the browser. is a pretty well known js to python compiler and there are some others out there too.

1 Like

Thanks guys. Looks like there is opencv.js and apparently works well with react native. So looks like that is the course I should take.

What kind of image processing? Real time dynamic image creation that runs on js or image file manipulation, writing and resizing?

If you use file manipulation try pillow which is a fork of PIL.

For dynamic images in JS, google search and explore dynamic js images and canvas

1 Like

Thanks for the info! My proof of concept is with pillow and python :slight_smile: I am manipulating the binary value of pixels.

I dont know if I need the back end with python running on an aws server, or if I can do the work easily enough within the app in js.

Python programming with OpenCV Dafont MapQuest FileHippo : This will allow you to do things like read in image files, manipulate them, and read images into your code (as matrices of RGB values).