Whatever message this page gives is out now! Go check it out!
| Parameter | Description |
img | Required. The ColdFusion image on which this operation is performed. |
color | Required. The transparent color:
Multiple transparent colors can be specified using an array. |
<cfset myImage=ImageNew("",200,110)>
<!--- Set the drawing color to green. --->
<cfset ImageSetDrawingColor(myImage,"green")>
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Draw a filled green oval on the image. --->
<cfset ImageDrawOval(myImage,5,5,190,100,"yes")>
<!--- Display the image in a browser. --->
<cfoutput>PNG image<br></cfoutput>
<cfset ImageWrite(myImage,"#expandpath('.')#/png.png")>
<cfset myImage = ImageRead("#expandpath('.')#/png.png")>
<cfimage source="#myImage#" action="writeToBrowser" >
<cfset x =ImageMakeColorTransparent(myImage,"green")>
<cfimage source="#x#" action="writeToBrowser" ><cfscript>
myImage = imageNew("", 200, 200);
myImage = imageMakeColorTransparent(myImage,["255,255,0","123,123,123","0,0,10"]);
cfimage(action="writeToBrowser", source=myImage);
</cfscript><cfscript>
// create array of transparent colors
arrayOfColors=["237,27,36","35,177,77","255,127,38","112,146,191","254,174,201","185,122,87"];
imgObj = imageRead("path/to/image/sample.jpg");
cfimage(action="writeToBrowser", source=imgObj);
img2=ImageMakeColorTransparent(imgObj,arrayOfColors);
cfimage(action="writeToBrowser", source=img2);
</cfscript>Input image | Output image |