Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok so this would be a combination of JavaScript and PHP, being able split the images in PHP would not be to hard, but you would have to remember that you need some organization with the files so that the JavaScript knows the order they should go in to be a complete puzzle.</p> <p>Instead of splitting the image itself, your would be better of taking slices of it using mathematical methods.</p> <pre><code> 1 2 3 ------------------- 1 | | | | ------------------- 2 | | | | ------------------- 3 | | | | ------------------- </code></pre> <p>Ok so an image is 300 x 300 pixels you would need to divide the width and height by the amount of images required dived by 2, for example:</p> <pre><code>$ImagesRequired = 9; $GlobalImageWidth = 900; $GlobalImageHeight = 900; $EachImageWidth = $GlobalImageWidth / ($ImagesRequired / 2); $EachImageHeight = $GlobalImageHeight / ($ImagesRequired / 2); </code></pre> <p>Both of the values should be 66~ pixels, you would then move around the image taking chunks of the image using crop.</p> <pre><code>for($x=0;$x&lt;=$GlobalImageWidth;$x = $x+=$EachImageWidth) { } </code></pre> <p>Looking at the graph above you would you take images in incremental order so you would accumulative the following dimensions.</p> <ul> <li>1.1 = 0 x 66.6</li> <li>1.2 = 0 x 133.33</li> <li>1.3 = 0 x 196.66</li> <li>2.1 = 66.6 x 66.6</li> <li>2.2 = 66.6 x 133.33</li> <li>2.3 = 66.6 x 196.66</li> <li>...</li> </ul> <p>So now you have calculated the dimensions that each image should be cropped at, you would use GD or Imagik libraries to slice the image, creating an array of images that you can then store in the cache.</p> <p>The above may not be 100% correct as it's late here and im not an expert in maths or image manipulation but hopefully this will get you started, also to see some great work done in Imagik and image manipulation see the following link, it should help inspire you.</p> <p><img src="https://i.stack.imgur.com/080d0.jpg" alt="ugly Mosaic"></p> <ul> <li><a href="http://lab.digitalinitiatives.net/mosaic/" rel="nofollow noreferrer">Generated Mosaic</a></li> <li><a href="http://lab.digitalinitiatives.net/?page_id=8" rel="nofollow noreferrer">The explanation and source codes</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload