Skip to main content
Known Participant
November 26, 2021
Question

Ways to manipulate images using coldfusion

  • November 26, 2021
  • 2 replies
  • 595 views

Coludfusion version: 2018

Goal is to manipulate images when given x and y coordinates from clients for adding text(s) and e-sign or thumbnail images onto parent image without comprimising the resolution (pixels) and dimenssions of the image. I tried all different image functions available with no much luck.

Looking to find solution either by using third party tool, upgrading coldfusion version or purchasing add ons to coldfusion engine. Does any one has any suggustions?

    This topic has been closed for replies.

    2 replies

    James Moberg
    Inspiring
    December 2, 2021

    Interested in using the command line?  (This has been our approach for manipulating and generating images and PDFs using ColdFusion 8-2021. This has allowed for more options, faster generation, multithreading & better quality.)

    GraphicMagick?  (It's opensource.  I've used this to add text to images.)

     

    If you want to create a new image, I've used WKHTMLTOPDF (opensource) to generate PDFs from modern HTML that overlays images & SVG images (with transparancies or alpha channel opaqueness) over other elements. There's also a WKHTMLTOIMAGE executable that would convert the HTML to PNG/JPG. You could use document size and CSS to enforce the same dimensions.

    Known Participant
    December 8, 2021

    Thank You for your response. I cannot use commnad line becasue these needs to be built on-demand. I also cannot use HTML because our client provides images

    Known Participant
    December 8, 2021

    I was able to manupulate using image tags and I believe I got most of it working except I cannot use the fonts that I really want to use

    local.dupImage = arguments.coldfusionImage;
    local.imageInfo = ImageInfo(local.dupImage);
    ImageSetAntialiasing(local.dupImage);
    ImageSetDrawingColor(local.dupImage,arguments.lineConfig["lineColor"]);
    //Had to use bufferImage and other objects to correctly determine x and y coordinates.
    //Used this as basis https://www.bennadel.com/blog/1150-gettextdimensions-for-finding-coldfusion-image-text-dimensions.htm
    local.attributeCollect = {};
    local.attributeCollect["font"] = arguments.lineConfig["lineFont"];
    local.attributeCollect["size"] = arguments.lineConfig["lineFontSize"];
    local.attributeCollect["style"] = arguments.lineConfig["lineFontStyle"];
    local.dupImage.drawText(arguments.lineConfig["lineText"], local.xCenterFinal, local.ycenter,local.attributeCollect);

     

    BKBK
    Adobe Expert
    November 28, 2021

    I think that the use-cases that you mention will be best served by a specialist imaging application or library. You might have to buy it or to pay to use it..

     

    Search for one that ticks all your boxes. When you find it, return to the forum and let's discuss whether it can be integrated in ColdFusion. 

    Known Participant
    December 2, 2021

    What classess does cfimage uses to process images?

    ImagePlus and ImageProcessor from ImageJ library was one of my options.

    Known Participant
    December 2, 2021

    ImgLib2, ImageIMAJ as well