Java – extensible clip mask
I need to cut the variable image into pieces (not squares) in such a puzzle shape: http://www.fernando.com.ar/jquery-puzzle/
I have considered the possibility of using PHP libraries such as Cairo or Gd, but I have little experience in using these libraries, and I can't see dynamic analysis dynamically scalable images of different sizes for creating clip masks
I am looking for guidance / tips on which server-side programming language to use to complete this task, and the best way to solve this problem
Solution
You can use GD to create an image with the size of a puzzle block Then copy the complete image on the image with the correct clipping to obtain the correct part of the image
You can then use different colors (for example #0f0) to dynamically shade each part of the part you want to delete, and then use imagecolorallocatealpha to make the color transparent For each piece of work, you have your server - side image
However, if I were there, I would create a clip mask for each puzzle in advance with a unique color This will cause each connection to produce two images (one with a "Circular" connector protruding and the other with a suitable connection for this circular connector) This way you can copy these masks onto the image and quickly create beautiful edges