Description

Inverts the pixel values of a ColdFusion image.

Returns

Nothing.

Category

Image functions

Function syntax

ImageNegative(name)

See also

ImageBlurImageGrayscaleImageSetAntialiasingImageSharpenIsImageFile

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

Required. The ColdFusion image on which this operation is performed.

Usage

The resulting image has the same dimensions of the source image, but not necessarily the same number bytes. Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- This example shows how to create a negative version of an image. --->
<!--- Create a ColdFusion image from and existing JPEG file. --->
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage">
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Create a negative version of the image. --->
<cfset ImageNegative(myImage)>
<!--- Save the modified image to a file. --->
<cfimage source="#myImage#" action="write" destination="test_myImage.jpg" overwrite="yes">
<!--- Display the source image and the negative image. --->
<img src="../cfdocs/images/artgallery/jeff05.jpg"/>
<img src="test_myImage.jpg"/>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy