Continuing my week off playing around with cfimage, I am thinking this is fast becoming my favorite new feature in Coldfusion 8. This morning I was thinking it would be cool if Coldfusion could watermark images for me. After about 30mins playing around I came up with this.
<cfimage source="img_2566.jpg" name="image">
<cfimage source="watermark.png" name="watermark">
<cfset ImagePaste(image, watermark, 0, 0)>
<cfimage source="#image#" action="writeToBrowser" format="jpg">
First 2 lines I basically give both images a name. The reason the watermark is a png is I want to have the ability to use alpha channels. Next line I paste the watermark onto the image at 0x and 0y. I cheated and created the images the same size, but you could easily read the image info get the size then calculate where you want the watermark to be. The last line writes the image to the browser in the format of a jpeg. You can check it out in action at my
CFwatermark page.