Again, you did not write, but what do you want to do with the picture after you have cut it.
Suppose you just want to show 2 halves.
Then the task is very simple and done by means of css. Let's say there is a picture with icons (for example, 2 pieces one under the other). And you need to bring them to different places.
We do it with the help of background-position (as if we are starting to draw half the picture above):
<style> #foto-1 { background-image: url(photo.png); width: 100px; height: 100px; overflow: hidden; } #foto-2 { background-image: url(photo.png); background-position: 0 -100px; width: 100px; height: 100px; overflow: hidden; } </style> <div id="foto-1"></div> ... <div id="foto-2"></div>
All these properties (background-position, width, etc.) instead of css can be set using javascript. There is nothing complicated.
If you want to save on the server, then see the solution from AirCrisp. Although I would transfer the image completely and cut it with the server, so more image formats can be supported and not tied to the browser.