Image Processing in Front End with Python?

Image Processing in Front End with Python?
0

#1

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?
thanks!
-Josh


#2

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.


#3

JavaScript is the only code that runs in the browser.

https://coffeescript.org/ is a pretty well known js to python compiler and there are some others out there too.


#4

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.


#5

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
https://www.codeproject.com/Articles/221941/HTMLImage-Generating-Dynamic-Image-using-Plain-Jav


#6

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.


#8

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).