imageNegative

Inverts the pixel values of a ColdFusion image.

imageNegative(name) → returns void

Member Function Syntax

someImage.negative()

Argument Reference

name string
Required

The image on which this operation is performed.

Examples
Sample code invoking the imageNegative function

CF 11+ Convert image to negative

imgObj = imageRead("https://placekitten.com/408/287");
imgObjNegative = duplicate(imgObj);
imgObjNegative.negative();
cfimage(action="writeToBrowser", source=imgObj);
cfimage(action="writeToBrowser", source=imgObjNegative);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub