Posted in ColdFusion | Posted on 08-07-2009 | 3,701 views
Been a while since I posted a challenge, and today I had a good idea for a new one. Given a source image, divide the picture into 100 squares, and then paste these squares into a new picture in random order. This will create a mixed up version of the source image. You can assume a decent sized image (minimum of 200x200 pixels). Post your solution, and if you can, URLs to some sample output. As one hint, don't forget ColdFusion has the ability to paste images into canvases.


http://209.200.68.149/imagetest.cfm
Yes, I'm using the free CF9 hosting graciously provided by CrystalTech :)
Will link to the code from the same page, once I get it cleaned up a bit :)
http://209.200.68.148/image.cfm
Code:
<cfimage name="imgGlobe" source="globe.jpg">
<cfimage source="#imgGlobe#" action="writeToBrowser" >
<!--- Destination Image --->
<cfset imgC = ImageNew("",400,400,"argb")>
<cfset imgA = imgGlobe>
<!--- Loops will create our 100 squares --->
<cfloop from="0" to="360" step="40" index="x">
<cfloop from="0" to="360" step="40" index="y">
<cfset imgA = imgGlobe>
<!--- Get the Image Area square --->
<cfset imgB = ImageCopy(imgA,x,y,40,40,x,y)>
<!--- Paste the image to our destination --->
<cfset ImagePaste(imgC,imgB,y,x)>
</cfloop>
</cfloop>
<cfimage source="#imgC#" action="writeToBrowser">
http://www.bennadel.com/resources/demo/jquery_puzz...
I created one with my own image, just don't have public facing CF space.
http://www.coldfusionjedi.com/demos/maimage/
Thanks Ray for graciously hosting this.
I'd also love to see a blog post written up on how you did it (I know I can view the source, but I'd still like to see a write up).
$("#sortable").sortable();
That's it?!
yes, the jquery ui library kicks ass.
I tried it with HTML 5 and JavaScript/jQuery.
http://www.codymarquart.com/projects/image100/
http://code.project924.com/img-functions/cut-and-r...
You have got to be joking .. a one liner? Damn. That _is_ awesome. Hats off to @Mathew.
@Mike,
(Despite the Horrible Hasselhoff cover ;-) Great work!
Here's my attempt .. makes me feel old school !
http://www.drg1.com/challenge.cfm
http://bjarte.dev.inbusiness.no/canvas/index.html
[Add Comment] [Subscribe to Comments]