Search code examples
pythongithub-pages

Can I manipulate an image in the browser with github pages?


Is it possible to upload and manipulate a photo in the browser with GitHub-pages? The photo doesn't need to be stored else than just for that session.

PS. I'm new to this area and I am using python to manipulate the photo.


Solution

  • GitHub pages allows users to create static HTML sites. This means you have no control over the server which hosts the HTML files - it is essentially a file server.

    Even if you did have full control over the server (e.g. if you hosted your own website), it would not be possible to allow the client to run Python code in the browser since the browser only interprets JavaScript.

    Therefore the most easy solution is to re-write your code in JavaScript.

    Failing this, you could offer a download link to your Python script, and have users trust you enough to run it on their computer.