Comment on page
Image Manipulation
Both CFML engines (Lucee & Adobe) have a very extensive and awesome image manipulation library that will allow you to create and manipulate images in an easy syntax. We cannot see every single detail about image manipulation, but it is necessary to understand that this functionality is easy in CFML and it exists.
Apart from having core image functions all functions can be applied as member functions to an image object. Yes, CFML allows you to deal with image objects natively.
imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.resize(50,50);
cfimage(action="writeToBrowser", source=imgObj);
imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.blur(5);
cfimage(action="writeToBrowser", source=imgObj);
imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.rotate(90);
cfimage(action="writeToBrowser", source=imgObj);
imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
info = imgObj.info();
writeDump(info);
You can find some great samples here: https://cfdocs.org/cfimage and a listing of all manipulation functions here: https://cfdocs.org/image%2Dfunctions
- GetReadableImageFormats Returns a list of image formats that Lucee can read on the operating system where Lucee is deployed.
- GetWriteableImageFormats Returns a list of image formats that Lucee can write on the operating system where Lucee is deployed.
- ImageClearRect Clears the specified rectangle by filling it with the background color of the current drawing surface.
- ImageDrawImage this function is deprecated, use ImagePaste instead. Draws a image on a image with the baseline of the first character positioned at (x,y) in the image.
- ImageDrawText Draws a text string on a image with the baseline of the first character positioned at (x,y) in the image.
- ImageFilterColorMap These are passed to the function ImageFilters (see ImageFilter documentation) which convert gray values to colors.
- ImageFilterWarpGrid A warp grid. These are passed to the function ImageFilters (see ImageFilter documentation).
- ImageGetBlob Retrieves the bytes of the underlying image. The bytes are in the same image format as the source image.
- ImageGetEXIFMetadata Retrieves the Exchangeable Image File Format (EXIF) headers in an image as a CFML structure.
- ImageGetIptcMetadata Retrieves the International Press Telecommunications Council (IPTC )headers in a image as a struct. The IPTC metadata contains text that describes the image that is stored with it. IPTC metadata includes, but is not limited to, caption, keywords, credit, copyright, object name, created date, byline, headline, and source
- ImageInfo Returns a structure that contains information about the image, such as height, width, color model, size, and filename.
- ImageOverlay Reads two source images and overlays the second source image on the first source image.
- ImagePaste Takes two images and an (x,y) coordinate and draws the second image over the first image with the upper-left corner at coordinate (x,y).
- ImageRotateDrawingAxis Rotates all subsequent drawing on a image at a specified point by a specified angle.
- ImageSetBackgroundColor Sets the background color for the image. The background color is used for clearing a region. Setting the background color only affects the subsequent ImageClearRect calls
- ImageSetDrawingAlpha Sets the current drawing alpha for images. All subsequent graphics operations use the specified alpha.
- ImageSetDrawingColor Sets the current drawing color for images. All subsequent graphics operations use the specified color.
- ImageTranslateDrawingAxis Translates the origin of the image context to the point (x,y) in the current coordinate system.
- ImageXORDrawingMode Sets the paint mode of the image to alternate between the image's current color and the new specified color.
Last modified 2mo ago