vendredi 28 août 2015

Extracting parts of an image based on a grid mask

I have been checking some jigsaw puzzle games around and I have noticed some of them use a grid image to extract pieces from an image. The image that represent the grid of pieces to extract is an image with white lines (the contour of pieces) and all the rest is just transparent. I have been struggling looking for ways to use this image to extract the pieces for my own game but haven't figured out how to do it.

Could anyone give any tip about how to use this image to extract the pieces?

An example of the image can be seen here. Take into account I have painted the white lines with a blue color to make it visible here at stack overflow:

enter image description here

Cheers.

Aucun commentaire:

Enregistrer un commentaire