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

ImageSharpen

Last update:
May 18, 2026

Description

Sharpens a ColdFusion image by using the unsharp mask filter.

Returns

Nothing.

Category

Function syntax

ImageSharpen(name [, gain])

See also

History

ColdFusion 8: Added this function.

Parameters

Parameter
Description
name
Required. The ColdFusion image on which this operation is performed.
gain
Optional. -1 <= gain <= 2.Gain values can be integers or real numbers. The default value is 1.0.The value determines whether the image is blurred or sharpened:
  • If > 0, the image is sharpened.
  • If = 0, no effect
  • If < 0, the image is blurred.

Usage

Use this function to sharpen outlines in photographs. Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<cfimage source="../cfdocs/images/artgallery/paul01.jpg" name="myImage">
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Sharpen myImage by 2. --->
<cfset ImageSharpen(myImage,2)>
<!--- Write the sharpened image to a file. --->
<cfimage source="#myImage#" action="write" destination="test_myImage.jpg" overwrite="yes">
<!--- Display the original and the sharpened images. --->
<img src="../cfdocs/images/artgallery/paul01.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