Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe Illustrator rasterize Script

  • rasterize Script

    Posted by Timur Solomon on May 27, 2022 at 11:21 am

    Hi, I’m trying to write a script to rasterize images with a clipping mask.

    But, I get, not the same image as if I did it through the program menu.

    The image has different dimensions. What am I not considering?

    var myDoc = app.activeDocument;
    var rasterizeOptions = new RasterizeOptions();
    //rasterizeOptions.includeLayers = true;
    rasterizeOptions.transparency = true;
    for (i = myDoc.groupItems.length-1; 0<=i; i -- ){
    var tLayer = myDoc.groupItems[i];
    var lName = tLayer.layer.name;
    //tLayer.layer.name = "M_"+lName;
    myDoc.rasterize(tLayer, tLayer.controlBounds, rasterizeOptions);
    };
    alert("Ok");

    As you can see in the image, the results of the program, the frames are crisp for the size of the image. Right part image

    The script takes into account the size of the image and goes beyond the mask. How to avoid it?

    Timur Solomon replied 3 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy