Overlaying 2 Images

In this tutorial i will show you how to over lay one image onto another using coldfusions built-in image functions, this method can be used to add a walter mark to an image.

First of all we need 2 images, here are my images image 1 and image 2 i will overlay image 2 onto image 1 using the ImageOverlay function.

We firstly get both of the images using the cfimage tag and give them names

<cfimage source="http://cfproject.co.uk/coldfusionsamples/clio.jpg" name="baseImage">
<cfimage source="http://cfproject.co.uk/coldfusionsamples/cfp.jpg" name="topImage">

We then simply overlay them using the Image Overlay function and write them to the browser

<cfset ImageOverlay(baseImage,topImage)>
<cfimage source="#baseImage#" action="writeToBrowser">

Here is an example of the finished image

Comments

Archives By Subject

Advertising (4) [RSS]
Blog Design (1) [RSS]
CFProject Scripts (2) [RSS]
Coldfusion Charts (3) [RSS]
Coldfusion Functions (5) [RSS]
Coldfusion Overview (1) [RSS]
Coldfusion Tutorials (17) [RSS]
For Sale (2) [RSS]
Image Manipulation (1) [RSS]
Java (1) [RSS]
JavaScript (4) [RSS]
PHP (1) [RSS]
Railo (2) [RSS]
SQL (1) [RSS]
Useful Tools (3) [RSS]

Recent Comments

Hashing Passwords
Richard Lord said: You really need to salt the passwords before hashing them, otherwise you're exposed to a rainbow-tab... [More]

Using Railo and Resin with domain aliases
Jonny Shaw said: Thanks for that. I am already using <host regexp="(.+)"> <host-name>${ho... [More]

Using Railo and Resin with domain aliases
Gert Franz said: Hi Jonny, it's even easier if you do it this way: <host id="allmead.com" root-dir... [More]

BlogCFC on Railo
Jonny Shaw said: Thanks for the advice ray. I was surprised at how easily BlogCFC went accross to to railo. The onl... [More]

BlogCFC on Railo
Gert Franz said: Congratulations to your new websites. I just wanted to add two things: CFIMAGE and CFCHART are suppo... [More]

Recent Entries

No recent entries.
ColdFusion Blog | ColdFusion Hosting | ColdFusion Q & A