Find fill colour frames in images

Hi All,
I am trying to find fill colour frames in images, my code is giving error as Object does not support the property or method "allPageItem"
could anyone solve this please.
var COLOR_NAME="color name string";
     var currentPageItem;
     for (var currentPageItem=0;currentPageItem<app.activeDocument.allPageItems.length;currentPageItem) {
          currentPageItem=app.activeDocument.allPageItem[currentPageItem];
          if ((currentPageItem instanceof Rectangle || currentPageItem instanceof Polygon)
                    && currentPageItem.contentType==ContentType.GRAPHIC_TYPE
                    && currentPageItem.fillColor==COLOR_NAME) { // do what you want
                app.activeDocument.selection=currentPageItem;
               alert("This box has fill color!!");
Thanks in advance
Steve

Hi Chinna,
Thanks for your reply, the code is working with your idea like
var COLOR_NAME="Red";
//~ var COLOR_NAME=app.activeDocument.swatches;
     var currentPageItem;
     for (var currentPageItem=0;currentPageItem<app.activeDocument.allPageItems.length;currentPageItem) {
         currentPageItem=app.activeDocument.allPageItems[currentPageItem++]
          if ((currentPageItem instanceof Rectangle || currentPageItem instanceof Polygon)
                    && currentPageItem.contentType==ContentType.GRAPHIC_TYPE
                    && currentPageItem.fillColor==app.activeDocument.colors.item(COLOR_NAME)) { // do what you want
                app.activeDocument.selection=currentPageItem;
               alert("This box has fill color!!");
Now, how can I find a fill colour in images (all colours which applied in images), could you change it please.
Thanks in advance
Steve

Similar Messages

  • Accurately finding spot colours in placed images

    Hi all,
    I'm trying to collate a list of the colours physically present in an artwork, including those in placed images which is where I'm having trouble.
    When an image is placed into an artwork, any spot channels present in a PSD (we only work with PSD's here) are brought in as swatches into Illustrator.  However if a spot channel is then removed from the image and saved, Illustrator reloads the image but doesn't realise that the channel has been removed and the colour remains in the swatch list.
    The Custom Colour suite reports that the colour is still there and used externally and separation preview still shows it as existing in the artwork.  Up to now I've been using exiftool to list the extra channels and parsing the output, but I'd prefer not to have to rely on an external dependancy.  There's nothing in the placed image's dictionary either.
    We also use a suite of (very expensive) plug-ins from large, Belgian graphics software company.  One of their plug-ins lists colours similarly to separation preview but it's completely accurate in it's representation of which colours are physically present in the artwork.  I'm not attempting to re-create it's functionality, rather generate the same information.
    Any suggestions would be hugely appreciated!
    Thanks
    -W

    Ok, it seems like I couldn't see the wood for the trees with this one.  I finally found the solution with AIFOConversionSuite::EnumerateContents(), which with closer inspection of the documentation, provides exactly what I needed... including that 'god I'm such an idiot' feeling
    I first tried traversing the artwork manually, then I discovered AIPathStyle::AdjustObjectAIColors() which provides some colour information but seems to have no knowledge of placed images.
    I guess you live and learn!
    -W

  • Quick Question - Find background colour of image?

    Hi guys,
    Its been years since I've used Photoshop, and I'm just trying out the Photoshop CS5 atm (a lot different from the simple PS7 that I was used to!) I've got an image that I want to find the background colour for, as I want to fill it to other images. I remember on the old versions if you erased an area the foreground colour would immediately just turn to the colour that you have deleted, but not anymore - I'm stuck!
    Any help, hope I've explained myself well!
    > Incidently, is there anyway I could purchase an old version of Photoshop? I'm a very infrequent user, and even the latest Elements software is pretty steep £50+. I'd happily pay a few pounds for Photoshop 7.
    thanks

    SongToRuin wrote:
    Hi guys,
    I remember on the old versions if you erased an area the foreground colour would immediately just turn to the colour that you have deleted, but not anymore - I'm stuck!
    I don't believe you're remembering a true difference in the Eraser Tool.
    With all versions of Photoshop, when you are working on the Background layer if you use the Eraser Tool it will paint in the color you have selected for the background swatch.
    With all the versions as well, if you're working on a true layer the Eraser Tool clears pixels to transparent.
    Now...
    If you use the Delete key, on the other hand, the operation becomes equivalent to Edit - Fill, and in the newest versions you're given a dialog with options.  There are modifier keys with which you can avoid the dialog.
    -Noel

  • JS CS3 How can I find -and delete- anchored empty images frames

    I have a script that works fine with text,
    I need the same function, but find and remove anchored empty image frames
    thx
    var myDoc = app.activeDocument
    for(var myCounter = myDoc.textFrames.length-1; myCounter>=0; myCounter--)
    var myFrames = myDoc.textFrames[myCounter]
    if (myDoc.textFrames[myCounter].contents == ""){
    myDoc.textFrames[myCounter].remove()

    I'd do it this way:
    1. Grab the document's allPageItems.
    2. Iterate over it, ignoring text frames.
    3. Check to see: (a) if the parent is a character and (b) if the graphics collection of the page item is empty. If so, delete it.
    Dave

  • Can I remove/adjust the white frame surrounding images in finder?

    I find the large white frames surrounding image files in the finder and on desktop bulky and annoying. Can this be changed/minimalised/removed in preferences or any other way?

    I've taken some screenshots so I can show what I'm talking about.
    LEFT: How images used to look when sitting on my desktop.
    RIGHT: How images on the desktop look in Mountain Lion.
    And here are what images look like in the finder in icon view:
    TOP: Images in the finder, old version.
    BOTTOM: Images in the finder in Mountain Lion.
    I want to get rid of those white borders. Or at least get them down to one pixel or something.

  • Changing fill colour for partly transparent images

    Does anyone know how to change the fill colour used for partly transparent images? I have a bunch of PNGs that I made for use as clip art, which I imported into iPhoto (that way I can use the media browser with Pages and Keynote).
    Unfortunately, the images (which are black) are shown on top of a black rectangle both in iPhoto and the media browser. I've tried changing the background colour to both gray and black, but the 'fill' colour stays black.

    There's no way to change it if you want to keep the transparency for use in other applications or web pages.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

  • Changing a frame's fill colour

    I should produce small text boxes containing reverse text (white letters in black boxes). How and where do I apply black colour to a frame's fill colour?

    Select the frame, then in the Swatches panel click the fill color icon in the upper left corner (same icon is in the Toolbox and the Color panel), then choose your fill color.

  • Problem changing fill colour after image trace?

    I am using illustrator cc 2014 to trace a jpeg image. After tracing I want to change the colour of the resulting image. The default colour after tracing is black but the image fill colour is showing as a question mark and when I go to change the colour the whole artboard turns grey no matter what colour I choose. I know the document is in CMYK. Does any one know whats going on here?

    Hi I'm still having trouble with this here are a couple of images of the before and after.
    This is the traced and expanded image:
    And after I select a colour:
    There are two problems with this, first is that its gone grey (I'm definitely in CMKY mode) and second is it did not fill the image in the way I had intended.
    What am I doing wrong?

  • Finding cells by content en replace stroke & fill colour

    I have generated in InDesign CS3 a catalogue with hundreds of tables.
    unfortunatly there was a mistake or two in building the tables. In a way I need to replace a stroke colour from a cell and also a fill colour.
    So my question is if there is a way in InDeisgn CS3 for automatically...
    searching in a document for table cells with "text colour Black_EN" AND "fill colour Black_EN" and change that particular cell stroke colour in Black_EN
    searching in a document for table cells with "text colour Black_EN" AND "fill colour Black" and change that particular cell fill colour in Black_EN
    Can someone help me with a usable script? I'm a newie to scripting so any help is usefull!
    thanks in advance, Pascal (form Belgium)

    Aaahh .. the old adage of one picture equalling a thousand words. In this case, the words are rather long, as the image is >280K.
    O-kay. You have lots of tables, possibly some with bad colors, but the text is always the correct color. How does this sound: you click inside any table, and the script checks the current text color (*). Then it sets all strokes to that color, and the fill of every cell with a 50% fill pattern. It means you can select a table, run the script, select the next, run the script, etc. until done (or utterly bored, whatever comes first).
    (*) Actually, the text color of the first character in the top left cell. I hope that's not a problem.
    The script is fairly indifferent to your selection: anywhere inside, in the text, or with a cell, row, column or even the entire table selected is no problem.
    Graag gedaan! (having them English folks choke on our Dutch gees)
    table = app.selection[0];
    if (table.hasOwnProperty("baseline"))
    table = table.parent;
    if (table instanceof Cell)
    table = table.parent;
    if (table instanceof Column)
    table = table.parent;
    if (table instanceof Row)
    table = table.parent;
    if (!(table instanceof Table))
    alert ("Echt niet in een tabel!");
    exit(0);
    color = table.cells[0].characters[0].fillColor;
    black = app.activeDocument.swatches.item("Black");
    table.cells.everyItem().properties = {
    topEdgeStrokeColor:color,
    bottomEdgeStrokeColor:color,
    leftEdgeStrokeColor:color,
    rightEdgeStrokeColor:color };
    for (aCell=0; aCell<table.cells.length; aCell++)
    if (table.cells[aCell].fillTint == 50)
      table.cells[aCell].fillColor = color;

  • How do I get my printer to match the colours of the image as I see it on screen?

    How do I get my printer to match the colours of the image as I see it on screen? My HP Office Jet Pro L7680 printer tends to print my images with a bias towards red compared to the image I am seeing on screen with Lightroom 5 using a Mac with Retina 5 screen. Would appreciate any expertise on how to calibrate the printer to the screen

    You have two options. The first method costs nothing but is not as accurate and the second means buying hardware and investing some time. The fastest way to get things closer is to download the color profile from the printer manufactures site for the printer and paper combination you are using. Install it on you Mac and relaunch LR. This is best when the paper and printer are both from the same company; in your case, HP. If the paper is not made by HP, you can often find profiles for your paper/printer by going to the paper maker's web site and doing a search for the appropriate profile.
    The other alternative is to purchase a piece of hardware such as the ColorMonki which can be used to not only profile your monitor for color balance but also you printer/paper as well as your camera. When all of your devices agree on what color 118,118,118 means, you get the same color from capture to print but this is also an expensive option and there is a lot of time involved in building your own color profiles. The results however, are much more accurate.
    Once you have a color profile installed, the next step involves doing soft proofing. Once you have your image looking the way you want it to in LR, open it in the soft proof option. This will show you how your print will look using the color profile for the paper/printer you are using. During the process, you will be shown the print on your screen which may look off. Use the small triangle in the upper-right corner of the histogram to turn on the out-of-gamut warning. This will highlight any parts of your image which contain colors your printer can't handle. Use the rendering intent options to decide how you want these colors handled (relative or perceptual). Check them both and use the one you like best. You can also make additional changes at this point if required before you generate the JPG image. Make sure to save it as a max quality JPG using the sRGP profile. Once saved, you can send this image to your printer or even to a lab as the process is the same.The attached link should get you to a video showing how to use the ColorMunki hardware/software but, more importantly, shows you how to prepare an image for printing (in this case, for a lab) using soft proofing with the color profile created (or downloaded).--Great Color from Your Lab Prints – Every Time! on Vimeo

  • Hey guys, I'm having trouble matching the colour of the image back ground (white) with the pre-set colour selection. is there a tool that can help me? thanks

    hey guys, I'm having trouble matching the colour of the image back ground (white) with the pre-set colour selection. is there a tool that can help me? thanks

    Your description of the problem is not quite clear so I made certain assumptions. I hope I am rigtht. I believe you have a color patch such as this:
    that you would like to place in an image area that has modeling in its white background. You do not want to lay in a flat color but rather to add a color and not lose the modeling or other background tone. The problem is, after making the selection, if you use Edit > Fill and set the Blending mode to Color, the white background remains white. The only colored background area may be an object's shadow or some similar area that is not pure white. (Image 2) It is an unsatisfactory result.
    If that is an accurate description of the problem, consider this:
    Image 1: The original image
    Image 2: Edit > Fill with the Blending mode set to Color. White remains white
    Image 3: Mode changed to Lab Color. Edit > Fill with the Blending Mode set to Color. Then return to RGB.
    (I would not normally use this green as a replacement color but since it is a Tiffany clock, I chose a light version of Tiffany's trademark color.)

  • Indesign CS5.5 - find Registration colour blank space

    Hi, I am trying to find spaces in my document which for some reason were coloured registration (0%). I thought I could do a find and replace and use the object tab but it doesn't seem to work? Anyone know if its possible to goto certain colours (like illus same fill colour)..
    Thanks

    Sorry, there were some character spaces left as Reg Colour. But I overlooked the find Text, and then clicked on the Find Format button > Character Colour and selected Registration. Thanks for responding though..

  • Find dpi & Align center of Image

    Hi All,
    I have new request but struggling in the below points:
    1. Find less than 300 dpi image in the active document
    2. Create text frame and fix center of the image vertically and horizotally.
    Hope I completed the script by 90%
    Completed Script:
    var myGraphics = app.activeDocument.allGraphics;
    var targetResolution = 300;
    for (var i = 0; i < myGraphics.length; i++) {
        try
        if (myGraphics[i].effectivePpi[0] < 300) {
            var myPPI = myGraphics[i].effectivePpi[0] + " dpi"             //please ensure this line should be correct
            var myName = myGraphics[i].itemLink.name;
            var myPage = myGraphics[i].parentPage;
            var myCaption = myPage.textFrames.add();
            myCaption.textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
            myCaption.contents = "FPO\r" + myName + "\r" + "Low Res " + myPPI;
            var bnds = myGraphics[i].parent.visibleBounds;
            myCaption.visibleBounds = [bnds[2] + 3, bnds[1], bnds[2] + 6, bnds[3]];
            myCaption.fit(FitOptions.FRAME_TO_CONTENT);
            try {
                var myPStyle = app.activeDocument.paragraphStyles.add({name: "Caption_lowres", justification: Justification.CENTER_ALIGN});
            } catch (myError) {
                  myCaption.parentStory.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("Caption_lowres");
            myPage.groups.add([myCaption, myGraphics[i].parent]);
    catch(myError)
    REQUIRED OUTPUT
    But Current Output using above script
    Thanks
    Beginner_X

    Hi Mr.Dave,
    Thank you for your response...
    I trying your code but I am not able to get the output.
    Could you help to get the output for me.
    var myGraphics = app.activeDocument.allGraphics;
    var targetResolution = 300;
    for (var i = 0; i < myGraphics.length; i++) {
        try
        if (myGraphics[i].effectivePpi[0] < 300) {
           var myPPI = myGraphics[i].effectivePpi[0] + " dpi"
            var myName = myGraphics[i].itemLink.name;
            var myPage = myGraphics[i].parentPage;
            var myCaption = myPage.textFrames.add();
            myCaption.textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
            myCaption.contents = "FPO\r" + myName + "\r" + "Low Res " + myPPI;
            var bnds = myGraphics[i].parent.visibleBounds;
            myCaption.visibleBounds = [bnds[2] + 3, bnds[1], bnds[2] + 6, bnds[3]];
            var center = {x : (bnds[1] + bnds[3])/2, y : (bnds[0] + bnds[2])/2}
            var capCenter = {x : (capbnds[1] + capbnds[3])/2, y : (capbnds[0] + capbnds[2])/2}
            myCaption.move(undefined, [center.x - capCenter.x, center.y - capCenter.y]);
             myCaption.fit(FitOptions.FRAME_TO_CONTENT);
            try {
                var myPStyle = app.activeDocument.paragraphStyles.add({name: "Caption_lowres", justification: Justification.CENTER_ALIGN});
            } catch (myError) {
                  myCaption.parentStory.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("Caption_lowres");
            myPage.groups.add([myCaption, myGraphics[i].parent]);
    catch(myError)
    Help me to get output as per attached screenshot
    Thanks
    Beginner

  • Im trying to make a simple 360 rotation for a 3d logo in CC 2014 but when i tried to create the 1st key frame the image when out axis

    im trying to make a simple 360 rotation for a 3d logo in CC 2014 but when i tried to create the 1st key frame the image when out axis

    I find that if you have multiple 3d object  they must be merged into a single 3d layer their positions reset to align to the same axises then sized and positioned along them. The layer should then be able to be animated well around an axis like the y axis. Here a Sphere, Cylinder and ring. http://www.mouseprints.net/old/dpr/McAssey-CC.mp4

  • Filled colour as a variable? and setting layer to not block the content underneath?

    I wonder if it's possible to take the filled colour (filled with  myColor.setRGB(0x993366); like a colouring style) and set the colour filled to be a value of a variable in an if statement? if yes, anyone know how to do it?
    and is it possible to set a layer's content so that it does not block any button underneath it? I'm trying use that movie as a mask but I do not want it to block any activity underneath it. or is it better to use the myMovieClip .setMask ( maskMovieClip )(I don't really know how to use this) I only need the masking to appear when a specific button is pressed. Hope my english isn't too confusing. Thanks.

    Yes. If you check the documentation for the Color class you will see there is a getRGB() method which returns the value set by the setRGB() method. However it doesn't tell you what color something is, it tells you what color transform has been assigned to that object. So if you make a movie of a red square and you do this:
    var myColor:Color=new Color(myClip);
    trace(myColor.getRGB()); // traces "0"
    Which could either mean it has been tranformed to black or that it has no transform (which is the case here.)
    What you are seems more complicated than it probably needs to be. What are you actually trying to do? How are these clips having their transforms assigned? What does it mean that they are a certain color.
    As for the layer thing. I have no idea what you are talking about.
    BTW, here is something you didn't ask for. Using the on(event) type handler coding went out of style with the introduction of Flash 6 in 2002. It is a very inefficient way to code and is very difficult to maintian because you have to look through all your items to find the code. Most folks these days put the code on the timeline where it is all in one place and easier to maintain. Here is a great article about it:
    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent

Maybe you are looking for