Whatever message this page gives is out now! Go check it out!

ImagePaste

Last update:
May 18, 2026

Description

Takes two images and an (x,y) coordinate and draws the second image over the first image with the upper-left corner at coordinate (x,y).

Returns

None

Category

Function syntax

<!--- image1 gets modified ---> 
ImagePaste(image1, image2, x, y)

See also

History

ColdFusion 8: Added this function.

Parameters

Parameter
Description
image1
Required. The bottom ColdFusion image.
Image2
Required. The ColdFusion image that is pasted on top of image1.
x
Required. The x coordinate where the upper-left corner of image2 is pasted.
y
Required. The y coordinate where the upper-left corner of image2 is pasted.

Usage

Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- Create a ColdFusion image from an existing JPEG file and name it "myImage1". --->
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage1">
<!--- Create a ColdFusion image from an existing JPEG file and name it "myImage2". --->
<cfimage source="../cfdocs/images/artgallery/maxwell01.jpg" name="myImage2">
<!--- Copy a rectangular region of myImage1. --->
<cfset resImage = ImageCopy(myImage1,1,1,50,50)>
<!--- Paste the rectangular area over myImage2. --->
<cfset ImagePaste(myImage2,resImage,100,100)>
<!--- Write the second ColdFusion image to result.jpg. --->
<cfimage source="#myImage2#" action="write" destination="test_myImage.jpg" overwrite="yes">
<!--- Display the two source images and the new image. --->
<img src="../cfdocs/images/artgallery/jeff05.jpg"/>
<img src="../cfdocs/images/artgallery/maxwell01.jpg"/>
<img src="test_myImage.jpg"/>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page