Converting an image to grayscale using the CFIMAGE tag in ColdFusion

The following example shows how you can convert an image to grayscale using the <CFIMAGE> tag in ColdFusion by using the imageGrayscale() method and setting the action attribute to writeToBrowser.

<div>
    <img src="../images/cf9.png" />
 
    <cfimage source="../images/cf9.png" name="logo" /> 
    <cfset imageGrayscale(logo) />
    <cfimage source="#logo#" action="writeToBrowser" format="png" />
</div>

And the output of the <CFIMAGE> tag is as follows:

Leave a Reply

Your email address will not be published.