Jump to content

PHP/JavaScript Autp Jigsaw Puzzle


twilitegxa

Recommended Posts

I am looking for any information on how I can go about creating a PHP/JavaScript jigsaw puzzle program that automatically creates jigsaw puzzles from a folder of images. Does anyone know what I can look up to get started on something like this?

Link to comment
https://forums.phpfreaks.com/topic/189660-phpjavascript-autp-jigsaw-puzzle/
Share on other sites

I can think of a way but its a bit complicated. You would need to make overlapping grids. I would start with a piece of graph paper and a standardized image size.

 

Start with the edges. You need a circle coords halfed. The half-circle is your out-crop/notch. Use overlap half of your circle. Use  the coords to overlay color from the L and R side of circle to the edge on a line across the bottom. if you do this on two sides and make the color transparent you now have a piece with two notches sticking out. You have to loop through each time opening the image again because you need overlapping slices.

 

It is involved and as I said mapping it out on graph paper you could map out the coords a bit easier than winging it with code at first.

 

You might consider using a perfect oval of two of different sizes. But mapping it out and using the graph grids as 10px you could easily map out a 300x300 image.

 

So you basically grid it out and center the circle/oval at a center point on the sides of the grid and map your overlays and overlapping grid sizes. Then crop the grid out and overlay then make the overlay color transparent. The notched pieces are fairly easy compared to the out-crop pieces.

 

 

HTH

Teamatomic

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.