Description
Converts a ColdFusion image to grayscale.
Returns
Nothing.
1 | ImageGrayscale (name) |
ImageBlur, ImageNegative, ImageSetAntialiasing, ImageSharpen, IsImageFile
ColdFusion 8: Added this function.
Parameter |
Description |
---|---|
name |
Required. The ColdFusion image on which this operation is performed. |
Use the ImageSetAntialiasing function to improve the quality of the rendered image.
1 2 3 4 5 6 7 8 9 10 11 12 | <!--- This example shows how to change a color image to grayscale. ---> <!--- Create a ColdFusion image from an existing color image. ---> < cfimage source= "../cfdocs/images/artgallery/jeff04.jpg" name= "myImage" > <!--- Turn on antialiasing to improve image quality. ---> < cfset ImageSetAntialiasing (myImage, "on" )> <!--- Change the image to grayscale. ---> < cfset ImageGrayscale (myImage)> <!--- Save the grayscale image to a JPEG file. ---> < cfimage source= "#myImage#" action= "write" destination= "test_myImage.jpg" overwrite= "yes" > <!--- Display the source image and the grayscale image. ---> <img src= "../cfdocs/images/artgallery/jeff04.jpg" /> <img src= "test_myImage.jpg" /> |