Color adjustment and the overlay to a placed image (this is a grayscale image)

So I will try to set the color of an image I placed a color point, then set it to overprint the fill.

I created a rectangle and adds these attributes. But I can't seam to get the same thing to work for a picture (gray scale).

Here are some of my code:





#target illustrator-19


var doc = app.activeDocument;
var sel = doc.selection;


var aiDocWidth = doc.width;
var iPath = sel[0].file.path + "/";//Name;
var origImage = sel[0].file;
var origImageFile = File(origImage);


  if(origImageFile.copy(decodeURI (iPath) + "/W_" + origImageFile.name)){
                //iFile[0].remove();
                };
var wImageFile = File(iPath+ "/W_" + origImageFile.name);


var psScript  = 'app.displayDialogs = DialogModes.NO;'; 
        psScript += 'app.open(' + wImageFile.toSource() + ');';
        psScript += 'app.activeDocument.changeMode(ChangeMode.GRAYSCALE);';  
        psScript += 'app.activeDocument.activeLayer.invert();';
        psScript += 'app.activeDocument.close( SaveOptions.SAVECHANGES );';  
        psScript += 'app.displayDialogs = DialogModes.ALL;'; 
        
btMessaging('photoshop',psScript);


placeImage(wImageFile,origImage,sel[0]);
        


function btMessaging( targetApp, script ) {  
          var bt = new BridgeTalk();  
          bt.target = targetApp;  
          bt.body = script;  
          bt.onResult = function( inBT ) { alert( 'Done…' ) };  
          bt.onError = function( inBT ) { alert( 'OOPS! something went wrong! :(' ) };  
          bt.send( 20 );  
}; 


function placeImage(fName,origImage,sel){
    
            var aDoc = app.activeDocument;
            
            var aLayer = aDoc.activeLayer;
            
                    //Flood white Color
                var floodWhiteCMYK = new CMYKColor;
                floodWhiteCMYK.magenta = 100;
  
                    //White Color object
                var floodWhiteSPOT = aDoc.spots.add();
                floodWhiteSPOT.name = "WhiteSpot";
                floodWhiteSPOT.color = floodWhiteCMYK;
                floodWhiteSPOT.colorType = ColorModel.SPOT;
                    //create instance of this object
                var floodWhiteColorSPOT = new SpotColor();
                floodWhiteColorSPOT.spot = floodWhiteSPOT;
            
           var pImage = aLayer.placedItems.add (origImage.top,origImage.left);
            pImage.file = fName; 
            pImage.name = "WhiteImage";
            pImage.selected = true;
            pImage.fillColor = floodWhiteColorSPOT;
            pImage.fillOverprint = true;
       
            var origI = sel;
            var x = origI.position[0] + (origI.width / 2);
            var y = origI.position[1] - (origI.height / 2);
            
            // move image 
            pImage.position = [x - (pImage.width / 2),y + (pImage.height / 2)];
       };

PlacedItems don't colorize of property or methods, overprint property too.

However, we can define the color by Colorize method together with overprint property after converted to the use of embedded rasterItems method.

Here is a small code example:

var clr= new CMYKColor;
clr.cyan = 50;
clr.magenta = 50;
clr.yellow = 0;
clr.black = 0;

app.selection[0].embed(); //selection[0] must be placedItem
app.selection[0].rasterItems[0].overprint = true;
app.selection[0].rasterItems[0].colorize(clr);

Tags: Illustrator

Similar Questions

  • I was wondering what the difference was between the powerbeats 2 and the powerbeats 3. What is this new "chip" in the powerbeats 3?

    I was wondering what the difference was between the powerbeats 2 and the powerbeats 3. What is this new "chip" in the powerbeats 3?

    Hello

    Main differences are:

    • Up to 12 hours of battery life with Powerbeats3, which use chips to W1 Apple energy-efficient (vs. up to 6 hours of battery life with Powerbeats2).
    • A quick charge of 5 minutes for a typical use of an hour (vs 15 minutes to load).
    • Improved ergonomic design.

    More information:

    http://www.Apple.com/shop/product/MNN02LL/A/powerbeats3-wireless-earphones-shock-Jaune

    http://www.beatsbydre.com/earphones/browse-earphones/wireless-earphones/ML8V2.ht ml

  • When I connect and the home screen appears I get this message: DLL environment initializeO-multiple Logger could damage files.

    Original title: Logger initialized O

    When I connect and the home screen appears I get this message: DLL environment initializeO-multiple Logger could damage files. What should I do? Thank you - E.Schmidt

    Hello

    1 how long have you been faced with this problem?
    2 did you recent hardware or software changes to your computer before this problem?
       
    Try to perform the clean boot on the computer.
     
    From your computer by using a minimal set of drivers and startup programs so that you can determine if a background program is interfering with your game or program. This type of boot is known as a "clean boot".
     
    Follow the steps provide in the article below to perform the clean boot. http://support.Microsoft.com/kb/929135

    Thanks and greetings
    Umesh P - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • error on my dvd windows can't read the dvd, and the answer is: Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

    I have an error on my windows dvd cannot read dvd and the answer is: Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

    can you help me please

    Thank you

    If you are uncomfortable with the use of the registry, try this

  • How to batch, fusion of the 3 different images? I use molten and the total of 240 different images.

    How to batch, fusion of the 3 different images? I use molten and the total of 240 different images.
    is there any script for it?

    like photoshop, batch processing is unable to identify 3 different images and merge these three images. Instead, it performs the action on a single image.

    Thank you

    under the direction

    // 2015, use it at your own risk;
    #target photoshop
    var theFolder = Folder.selectDialog ("select folder");
    if (theFolder) {
    ////////////////////////////////////
    var theFolders = theFolder.getFiles(getFolders);
    for (var a = 0; a < theFolders.length; a++) {
    var theFiles = Folder(theFolders[a]).getFiles(/\.(jpg|tif|eps|psd)$/i);
    ////////////////////////////////////
    // open first image;
    theFile = app.open(theFiles[0]);
    var basename = theFile.name.match(/(.*)\.[^\.]+$/)[1];
    // place other files;
    for (var m = 1; m < theFiles.length; m++) {
    placeScaleRotateFile (theFiles[m], 0, 0, 100, 100, 0, false);
    // set to screen;
    theFile.activeLayer.blendMode = BlendMode.SCREEN
    };
    // save as psd;
    psdOpts = new PhotoshopSaveOptions();
    psdOpts.embedColorProfile = true;
    psdOpts.alphaChannels = true;
    psdOpts.layers = true;
    psdOpts.spotColors = true;
    theFile.saveAs((new File(theFolder+'/'+basename+".psd")),psdOpts,false);
    };
    };
    ////////////////////////////////////
    ////// place //////
    function placeScaleRotateFile (file, xOffset, yOffset, theXScale, theYScale, theAngle, linked) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theYScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theXScale );
        var idAngl = charIDToTypeID( "Angl" );
        var idAng = charIDToTypeID( "#Ang" );
        desc5.putUnitDouble( idAngl, idAng,theAngle );
    if (linked == true) {
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
      };
    executeAction( idPlc, desc5, DialogModes.NO );
    // get layerid;
    var ref = new ActionReference();
    ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("layerID"));
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var layerDesc = executeActionGet(ref);
    var layerID = layerDesc.getInteger (stringIDToTypeID ("layerID"));
    // =======================================================
    return [app.activeDocument.activeLayer, layerID];
    };
    ////// get folders //////
    function getFolders (theObj) {
    if (theObj.constructor == Folder) {return true}
    };
    
  • I can not install Lightroom 6 on my laptop using 8.1 to WIN.  The installer asks me to connect and when I do after 20 sec freezes the computer and the battery needs to restart.  This prevents the work online help.  What can I do?

    I can not install Lightroom 6 on my laptop using 8.1 to WIN.  The installer asks me to connect and when I do after 20 sec freezes the computer and the battery needs to restart.  This prevents the work online help.  What can I do?

    Settle in the right forum.

  • Lumetri of color adjustment causes the collapse of the Red

    First of all I must say that I love the color Lumetri Panel.  But I came across a problem with red in my final rendering, and I've encountered this problem before.

    After using Lumetri color correction, he looks a lot like the timeline, but then in my final rendering, I get this block crap that resembles a small MPEG flow...ADOBE QUESTION- RED BREAKUP.png

    In this particular clip, I had to correct the colors, which I made using RGB curves and color saturation then brought in broadcasting trunk using the Saturation, tone curve, and basic Correction has also been used to add exposure, contrast, tint and a warmer color temperature.  Like I said, it's beautiful on the timeline, but then I give it back using a high flow rate (H.264, MOV or MP4, ' Match source broadband ') I get this polyhedral shit.  I didn't when I used the CineForm MOV, but I can't send in this codec because of the lack of compatibility in the players, and when it will broadcast, I doubt networks will accept CineForm.

    Everyone race in this issue?  Suggestions?

    Classified as a dream without the artifacts and the own reds.  H264 HI bitrate

  • Since the update to el capitan the "key and the @ changed." How to remedy this anomaly?

    the "key and the @ key have been reversed since update to El Capitan."  How can I fix it?

    Hello! Open System Preferences - keyboard - input Sources and make sure you have the U.S. keyboard layout.

  • I made a Web site, and the domain name is tschantre with this special e (colleague). but it gives me an error, how can I handle this?

    How can I manipulate can I gibe the domain name with the e - any code? or something else?

    Could you please confirm, you get the error message and either when adding domain in the file > export to HTML or file > download on FTP host option or if there is another place, you are referring to?

    I checked and the export and download of FTP options both accept accented characters in the domain name field.

    See you soon,.

    Vikas

  • How can I change the color in a search for visited sites window? I'm partially color blind and the default colors are very difficult to tell one from the other.

    When I look at a page of search engine results, I would like the colors of the results visited a much more different color than they are today. As v.s. blue black or blue v.s. yellow.

    You are welcome

    Disable the website of colors in the preferences (options) can have all kinds of side effects because it also disables background images and as such can cause buttons or links that consist exclusively of a background image to get invisible.

    The NoSquint extension is much better in dealing with these issues.

  • color change and the appearance screen

    the screen in which we change the color and appearance is now different than it has been
    now, it's like a window xp. How to restore?

    Hello

    Try the system restore before that happened:

    How to make a Vista system restore
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html
    =================================

    If necessary:

    How to change the color scheme in Vista - see also useful links here
    http://www.Vistax64.com/tutorials/83824-color-scheme.html

    How to change the appearance settings in Vista - see also useful links here
    http://www.Vistax64.com/tutorials/78281-advanced-appearance.html

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • Programmatically read shape color fill and the race?

    Somehow, I have been unable to figure out exactly how to do this, although I suspect, that he should be dead simple!

    All I want to do is read the color of fills & strokes on some items that I imported from Adobe Illustrator. They have very specific colors applied to them, such that I can analyze (I hope!) and know what to do with the objects according to their unique color.

    All appreciated help/sample code!

    which is not simple and based on your description can still be done.

  • How to connect two ESXi hosts with a connection to 1Gbps via ADJUSTABLE and the transfer of files between them?

    Dear community,

    Like many of you, I am facing the problem of executing an effective backup of VMs. unfortunately I can't use standard methods: my servers are rented from the root servers and therefore haver some limits. Their main NIC is connected to the Internet on the speed of 100 MB. It's very slow, if I try to VM backup via this connection images. In addition, backup sessions running through the shared management interface are affecting the production of virtual machine performance.

    To resolve this problem, I ordered an additional network card to each server and asked the data center to connect my themwith a physical link (crossover cable). OK, between my servers 1Gbit link is established, but how do you use now?

    -I can not move the management interface of these cards, because they have no connection to the internet.

    -I can't use among the guest computers because the guest computer is unable to access the files on disk on the host computer.

    So, I've exhausted all my ideas. Maybe someone knows the trick that will let me use 1 GB link between two machines of ESXi to mutually backup disks of virtual machines from one host to another.

    Thanks in advance for your ideas.

    Who is King

    Anton

    Create a vSwitch on each host and set the NETWORK adapter that you will use with the x-over cable.

    Create a portgroup Console of service on each vSwitch and assign it an IP address on the same subnet for each server (router/gateway address does not necessary) for example 192.168.0.1 and 192.168.0.2 on each host.

    Connect the cables between the server network cards.

    You should have a link between two service consoles. I now download and deploy the device of the vMA, on the two hosts for the fault tolerance. Write a script on the VMAs on each host to a-i vmkfstools from one host to another and vice versa.

    If you have virtual machines registered pointing these VMDK on both hosts, then have your scripts remove the VMDK and re - the clone using vmfkstools whenever you back up, you should have a backup solution of rudimentary virtual machine (full copy) in place.

    Now you do not miss the service console?

    Good luck

    Alex

    www.phdvirtual.com

  • Windows media center on starting indicates there is a problem with the failure of a component of recording on the radio and the video how can I solve this problem

    Failure of a component of recording
    Some of the files needed to play radio are missing or corrupt. Registration of the media center components may have failed.

    The above message is displayed whenever I put Media Center on and try to watch television. The guide lists are also not downloading.
    And im having trouble with the tuner.
    Tuner not found
    the tuner is defective or not installed.

    someone help?

    Hello hillsiderWH,

    Seems that your windows installation is missing most important files, I suggest you boot to the top with your windows media center installation CD and run repair on the windows installation. This will replace any missing files and I hope that your media center up and running. If this isn't the case, it could be a problem in the registry.

    -Alex

  • I bought a legitimate copy of windows and the product key is blocked. This version has also been purchased by microsoft.

    I would like to request a new key product, sent to the e-mail address below that I got from microsoft has been blocked. I'm not impressed by the product you got supplied with. If you can please get in touch as soon as POSSIBLE.

    I'm very disappointed with what I've been delivered.
    contact me via this email;
    E-mail address is removed from the privacy *.
    Thank you very much
    A very unhappy customer.
    Kieran Baker

    Have you tried to restart by phone?

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

    Please run the Microsoft Genuine Diagnostics Tool then copy and paste the results into an answer here for further analysis:
    http://go.Microsoft.com/fwlink/?LinkId=52012

Maybe you are looking for

  • "Open all in tabs" reuses the existing tabs, how do I create new tabs instead?

    I have a few folders of bookmarks on my bookmarks toolbar. When I clicked on 'All open tabs' on one of those which I was surprised to see that he reused tabs I have what I've lost everything, I looked into these tabs. I want to create and use NEW tab

  • scan multiple documents to multiple files

    Is there a way to scan several documents at the same time and then drop them into a separate file?  I want to scan documents to and from different companies in different files.

  • Repeatedly offered the same three updates

    I had my computer (an Acer all-in-one destop) for a few months now and it froze on me once and he had automatic updates that would install when I went to close. So I had to reboot by pressing the power button. Now, it has been downloaded these same u

  • home network

    Hello everyone, I have a presario S3100NX and my daughter has an acer laptop. Both are xp victories. I want to set up a small home network. Which would be better/easier wired or wireless? Is it as simple as the addition of a router? Any information w

  • Problem with sending SMS programmatically to multiple recipients:

    Hello world I try to send information by SMS to multiple recipients at the same time programmatically. When I am trying to send SMS messages to a recipient, it works fine. I am able to send the data to a recipient successfully without any problems. B