Problems selecting color in action

Hi,
I am trying to create an action that will select a color in a specific spot of an image, say top right corner, in order to delete that color. For example, if I have two portraits, one on a blue background and another on a green background, I need the action to select the color range of a specific spot, that way it doesn't matter what color the background is to begin with, and then delete it. As it stands, selecting the color range only records the RGB value in the action and not WHERE that color is found.
I found this discussion helpful but did not work completely. http://forums.adobe.com/message/2720472
Any tips are greatly appreciated. I have thousands of these images and would rather not make an action for each background color.
Thanks!

You could use a script to get and  select colour, this could be called as part of your action.
The following code is set up to select the colour range of the top right hand pixel with a fuzz of 16
main();
function main(){
if(!documents.length) return;
///////////Amend to suit X and Y positions in pixels////////////
//X = 10;
//Y = 10;
//to select top right corner
X = activeDocument.width.as('px')-1;
Y = 1;
app.activeDocument.colorSamplers.removeAll();
var xPos = new UnitValue( X,'px') ;
var yPos = new UnitValue( Y,'px' );
var mySampler = app.activeDocument.colorSamplers.add([xPos,yPos]);
var myColor = mySampler.color;
app.activeDocument.colorSamplers.removeAll();
selectColourRange( 16, myColor); //fuzz to suit
function selectColourRange( fuzz, solidColor){
var scaleA = (solidColor.lab.a + 128.5) / 256;
    var desc11 = new ActionDescriptor();
    desc11.putInteger( charIDToTypeID( "Fzns" ), fuzz );
        var desc12 = new ActionDescriptor();
        desc12.putDouble( charIDToTypeID( "Lmnc" ), solidColor.lab.l );
        desc12.putDouble( charIDToTypeID( "A   " ), solidColor.lab.a + scaleA);
        desc12.putDouble( charIDToTypeID( "B   " ), solidColor.lab.b + scaleA);
    desc11.putObject( charIDToTypeID( "Mnm " ), charIDToTypeID( "LbCl"), desc12 );
    desc11.putObject( charIDToTypeID( "Mxm " ), charIDToTypeID( "LbCl" ), desc12 );
executeAction( charIDToTypeID( "ClrR" ), desc11, DialogModes.NO );

Similar Messages

  • Action written in CS4 won't run correctly in Elements 11 - specif. the "selective color" layer

    I created an action using Adobe Photoshop CS4, and it runs correctly in CS4.  When I save and load the action into Elements 11,  there is a problem with the selective color layer.  The selective color layer shows up in the layer stack along with the expected message that it can't be edited b/c it was created in the full version of Photoshop. However, the layer itself does not have any color/changes in it.
    In Photoshop, the selective color layer makes the photo look pink.  When I run the action in Elements11,the selective color layer does absolutely nothing to the photo.  I do have the eye turned "on" to view the layer, and it's set at the correct blending options & opacity (normal, 100%). 
    If I run the action in Photoshop, save the file with all the action-created layers, and reopen the file in Elements 11, THEN the selective color layer shows its correct pink color.  But when I run the action as a stand-alone action in Elements11, it does not.
    Can anyone offer help as to why this is happening? Is there something special I need to do to make the action work correctly in Elements 11? My understanding was that it should RUN and create the layers correctly, although some of them will not be editable in Elements11. However, as it stands, it is not creating them with the correct color.
    Thanks in advance for your help!

    You probaly need to record the action in a little different way in photoshop cs4 to get the selective color adjustment layer to work.
    Try something like this:
    1. In photoshop cs4 add an selective color adjustment layer, but don't do any adjustments and stop recording the action.
    2. Undo the selective color adjustment layer and then double click on on the selective color adjustment layer step in the actions panel
       and when the dialog opens set your adjustments and click ok.
    Now it should work in pse 11:

  • Select- Color Range- Results in Blue Screen (PC)  (driver out of date)

    I've been using the CS6 beta about two days.  While experimenting with color range I experienced two consecutive blue screen crashes.  The first time it happened,I was working with the color range selector and was replacing the selected areas with another color using the paint bucket.  About the third time I attempted this, my PC blue screened.  The second time, I opened a photo, went to Select>Color Range and got an immediate blue screen crash.
    I then went back to CS5 and I've been playing with the same scenario with no apparent problems.
    My PC is a store built computer.  It consists of an MSI 990-FXA GD80 motherboard, an AMD Phenom 1100t CPU, Asus GTX550 Ti graphics card and 8 gig of RAM.  It boots from a 60 gig SSD and my programs reside on a 500 gig hard drive.  The OS is Windows 7 Professional 64 bit.  CS6 is using the hard drive for its scratch disk and Photoshop is using 4339 mb of the 7232 mb of available RAM - I haven't changed that.  I'm running CS6 as administrator because the way it installed, it would only run in that fashion.
    One disappointment during the installation was CS6 made no attempt to read my preferences from the CS5 install.  That may be covered in another post, I've not yet looked.
    Please keep us informed as new betas are released, because I would like some time to work with this puppy before plunking down big bux for the upgrade.  As it is now, I'm going back to CS5.  I get mighty nervous when my super computer blue screens!
    Gerry
    gswetsky AT bellsouth DOT net

    The GPU is often at root of issues like yours. I've had so many problems with Nvidia drivers for their gaming-oriented adapters (like yours) that I finally went with one of their workstation cards. I have a Quadro card with just enough RAM to make Photoshop happy. The workstation drivers are optimized for reliability, the consumer card drivers are optimized for gaming and that often means they're less stable and reliable with Photoshop.

  • I'm using an iMac running Os X Yosemite, Photoshop CS5 Extended, R2880 Epson printer  In the Print Settings dialog box, I can't select Color, Advanced BW or Grayscale unless I select "Printer Manages Color". The pull down menu is grayed out. Even with "pr

    I’m using an iMac running Os X Yosemite, Photoshop CS5 Extended, R2880 Epson printer  In the Print Settings dialog box, I can’t select Color, Advanced BW or Grayscale unless I select “Printer Manages Color”. The pull down menu is grayed out. Even with “printer manages color” the tif or jpg image comes out in color overlaid with black. (See example - printer1. image on left is close to what it should be). Photoshop has no updates pending. I’ve downloaded the latest Epson driver which was working fine just before the problem occurred

    Is your Photoshop CS5 updated to 12.1?
    Are you on Yosemite 10.10.1 or Yosemite 10.10.2?
    Did you apply the recent Epson software 2.1.9 update?
    What type of file is it (file format)?  What bit depth and what color space?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Problems with colors running CS4 and W7.

    Hey everyone.
    I'm having some MASSIVE problems with colors on my system.
    Windows 7 Prof 64bit
    Photoshop CS4 64bit
    6g Ram
    1T hard drive
    Nvidia GeForce 9800 GTX+
    Dell SE198WFP Monitor 
    The system itself is a Dell Inspiron 530 that I put into a Black Widow V9 gaming tower. 
    Here is an example of the issue I'm having: 
    http://findae.deviantart.com/art/Converge-101214480
    http://i38.tinypic.com/bjcymr.jpg 
    The top image is a (admittedly old and crappy, but it shows the problem) photo that I had previously edited and put in my portfolio. The tinypic below is the result of copying that photo from the portfolio, pasting it into photoshop, and then saving it into a jpg. As you can see, the transitions between colors and the contrast are a complete mess. 
    Thing is, my hard drive recently quit on me, and I had to install the operating system and such on a new drive. I remember having this problem with the system when I first had it, but it either went away on its own or I fixed it somehow before. Now I can't remember for the life of me how I got rid of the problem, and I certainly don't know what the problem is in the first place. I'm tempted to think it may not be photoshop itself, but the problem seems to be especially bad when I'm working with photos. 
    Anyone have any idea what the problem might be and how to solve it? 
    Edit: I also noticed it when viewing http://findae.deviantart.com/gallery/#/d1hni37 in firefox, whereas the other photo appeared to be ok before I copied and pasted it. It has extremely obvious lines of green and orange in the transition from light skin tone to dark skin tone. Annoyingly enough, this doesn't show up in the thumbnail within my gallery at all, only when I click on the thumbnail and see the fullsize image. Extremely frustrating.  
    Here's another good look at the problem while selecting a color in photoshop: http://i37.tinypic.com/2h6t7gh.jpg  All I did was screenshot it a few times, and it deteriorated to that point.

    Screen glitches like color blocks appearing where they shouldn't could indicate a problem with your video drivers.
    Go to the nVidia site and see if they've released any updated drivers; people often report that updated drivers are correcting current problems with Photoshop.
    http://www.nvidia.com/object/win7-winvista-64bit-258.96-whql-driver.html
    Note the recent (3 weeks ago) release.
    -Noel

  • Selection Color of a text box

    As one of the project requirements, I have to provide a
    functionality in my application to be able to change the selection
    color of the text box. Having no provision in Flash, I searched on
    the net and found one good example of doing that with
    flash.geom.ColorTransform and TextFormat classes. It works fine
    with windows. However, it doesn't work on Mac OSX. I am using Flash
    8 with AS 2.0 for development.
    I am seeking some support from all the brilliant developers
    here. Can somebody help me with a solution to this problem?

    Create 4 radio buttons, all called the same name, but with export values of cent.grn, cent.amb, cent.red, cent.blk.
    Then use this as the custom calculation script for the text field:
    var v = this.getField("myRadioButtons").value;    //Replace myRadioButtons with the name of your radio button group
    if (v=="cent.grn"){
    this.getField("tf.assmnt.stat").fillColor = color.green;    
    else if (v=="cent.amb"){
    this.getField("tf.assmnt.stat").fillColor = [ "RGB", 1,.5,0 ];
    else if (v=="cent.red"){
    this.getField("tf.assmnt.stat").fillColor = color.red;
    else if (v=="cent.blk"){
    this.getField("tf.assmnt.stat").fillColor = color.black;

  • Background Selection Color

    I made a JTable in which you can set the row background color as you like for every row independently.
    The problem is that I would like the selection color to change accordingly to the background of the selected row (as it happens in many common programs such as Excel or Word). Is there any way to make it without implementing a palette that customizes the couples "Background Color" - "Selection Color"?
    Thanks in advance,
    Andrew.

    try the below code hope this is what u r looking for
    good luck.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class SelectionBackgroundColor extends JFrame
    JScrollPane jScrollPane1 = new JScrollPane();
    JTextArea jTextArea1 = new JTextArea();
    JPanel jPanel1 = new JPanel();
    JButton chgBgColorButton = new JButton();
    public SelectionBackgroundColor()
    try
    jbInit();
    catch(Exception e)
    e.printStackTrace();
    public static void main(String[] args)
    SelectionBackgroundColor selectionBackgroundColor = new SelectionBackgroundColor();
    selectionBackgroundColor.show();
    private void jbInit() throws Exception
    chgBgColorButton.setText("Change Background Color");
    chgBgColorButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    chgBgColorButton_actionPerformed(e);
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setLineWrap(true);
    jTextArea1.setText(
    "I made a JTable in which you can set the row background color as " +
    "you like for every row independently.\nThe problem is that I would " +
    "like the selection color to change accordingly to the background " +
    "of the selected row (as it happens in many common programs such as " +
    "Excel or Word). Is there any way to make it without implementing " +
    "a palette that customizes the couples \"Background Color\" - \"Selection " +
    "Color\"?\n\nThanks in advance,\nAndrew.\n");
    jPanel1.add(chgBgColorButton);
    jScrollPane1.getViewport().add(jTextArea1);
    getContentPane().add(jScrollPane1, BorderLayout.CENTER);
    getContentPane().add(jPanel1, BorderLayout.SOUTH);
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(this);
    pack();
    void chgBgColorButton_actionPerformed(ActionEvent e)
    JColorChooser jc = new JColorChooser();
    Color c = jc.showDialog(this, "Choose background color",
    jTextArea1.getBackground());
    if(c != null && !c.equals(jTextArea1.getBackground()))
    jTextArea1.setBackground(c);
    jTextArea1.setSelectionColor(new Color
    (255 - c.getRed(), 255 - c.getGreen(), 255 - c.getBlue()));
    c = jTextArea1.getSelectionColor();
    jTextArea1.setSelectedTextColor(new Color
    (255 - c.getRed(), 255 - c.getGreen(), 255 - c.getBlue()));
    jc = null;
    gkrao

  • Selection Color of JSlider

    I am making a GUI for a little software game.
    But i have a problem with my slider. I want to change the selection color from the tumb from the standard "beautiful" purple to another color.
    I've tried following settings , with UIManager.put("Slider.background",new ColorUIResource(Library.SETCOLOR)):
    Slider.background
    Slider.focus
    Slider.foreground
    Slider.highlight
    Slider.horizontalThumbIcon
    Slider.majorTickLength
    Slider.shadow
    Slider.trackWidth
    Slider.verticalThumbIcon
    SliderUI
    Slider.border     
    Slider.focusInsets     
    None of these settings worked.
    I also tried all the settings listed on the following URL :
    http://forums.e-plus.com.au/thread.jsp?forum=3&thread=93
    But they did'nt work either.
    Please help me out??

    Look in the documentation in the styles section.
    Sincerely,
    Michael
    El 15/05/2009, a las 5:26, kRizzl0r <[email protected]> escribió:
    >
    hi there,
    >
    i was wondering why the TextField's selection color in AIR is 
    different from the one in the flashplayer - and if there is a way to 
    change it?
    who chose a grey tone as highlight color, and an even lighter grey 
    when the TextField lost its focus? seems like a strange decision to 
    me..
    >
    cheers
    >

  • Image Trace colors don't match selected color group. (Mac, CS6)

    When I select the Document Library option when making a color image trace, the colors shift in the image but do not match the selected color group. I've tried multiple color groups, and the colors always change, but never match the selected swatches. Is this typical? Can anyone explain this?

    After some additional experimentation, I discovered the problem was with images dragged from iPhoto and dropped into an illustrator file. When I placed the files instead, the colors matched the selected color group. After trying several other images using both methods, it appears as if dragging and dropping from iPhoto is a no-no when wanting to image trace and change the colors.

  • Select Color Range, fails v13.1.1 on Retina Display Mac

    Is there a trick to getting the new Color Range selection function to work on a retina Mac Book Pro?
    I am quite familiar with the color range selection in the previous version of Photoshop, and used it regularly. I've decided to try as simply as possible by using a flat image (no layers), and trying to select colors. I've increased the contrast in the image to make darks and lights much easier to pull out.
    I've explored setting the sample size to point-sample up to 3x3, and 5x5. I've also set the resolution of my display to 2880 x 1800 (to reduce the possiblility of anti-aliasing problems).
    It will not make any selection though, using the eye-dropper sample.
    Using other options will work, such as Highlights, Shadows, Skin Tones, etc., but it won't do anything with Sampled Colors.

    SO very glad I'm not the only one with this seemingly EXACT same issue.
    System:
    Photoshop CS6 via Creative Cloud membership.
    Windows 7 Home Premium
    16GB Ram
    Issue:
    Select > Color Range used to work perfectly before update 13.1.1
    Now since the update 13.1.1 Color Range doesn't do jack properly. Selecting any color doesn't do anything. sometimes if I select a white it will act as though I've pulled out a gray.. but even one pixel difference will make it deselect. This only happens with Sampled Colors. All otehr color range preselections work as advertised. This would be great if I didn't need the precision afforded to me with Sampled Colors. This is mission critical to my daily work as a scren printing artist and have been unable to find a succesful workaround.
    Is there at least a way (without having to uninstall/reinstall) to downgrade back to 13.0.x until this bug is found and fixed?

  • JTable - DefaultTableCellRenderer overrides selection color

    According to the Api Docs, the setBackground method of the DefaultTableCellRenderer class should only "assign the unselected-background color to the specified color". In fact, it also seems to set the selection color: each cell with a DefaultTableCellRenderer which changes the Color does not get highlighted when selected. Even if I set the value to "null" no selection is visible.
    The same problem happens with setForeground ...

    In the 'How to use Tables' Java tutorial the default renderer's constructor has the following:
    setOpaque(true); //MUST do this for background to show up.
    Could this help you?
    Is the highlighting of the cell in any way tied to the cell editor as opposed to the cell renderer?

  • PS elements 12 freezing when doing selective color and having to force quit on Mac.

    PS elements 12 freezing when doing selective color and having to force quit on Mac.  I've uninstalled and reinstalled several times and that did not work.  I've changed preferences and that did not work and i tried hitting shift+command and option at start up of program and that did not fix the problem either.

    Hi,
    We sincerely apologize for the problem customers are facing while using a trackpad with Photoshop Elements 11 & 12 on Mac OSX 10.10 (Yosemite).
    We have been actively working with Apple to resolve this problem as quickly as possible. We're hopeful this will get completely resolved in an upcoming update of Yosemite(MAC 10.10).
    In the meanwhile, you have two options to work around this problem:
    1. Option1: Use a mouse instead of the trackpad
    2. Option2: Install a plug-in which should workaround the problem
    Plug-in installation instructions:
    1. Close Photoshop Elements
    2. Download this zip file to a location you can easily find (e.g. your desktop)
    3. Unzip the file, WhiteWindowWorkaround.plugin, and move it to the Plug-In folder:
    • For Elements 12 – //Applications/Adobe Photoshop Elements 12/Support Files/Plug-Ins/
    • For Elements 11 - //Applications/Adobe Photoshop Elements 11/Support Files/Plug-Ins/
    You can verify the plug-in is installed by launching the Photoshop Elements Editor and choosing Help > System Info... Scroll to the bottom of the text in the dialog and look for the plug-in name "WhiteWindowWorkaround.plugin".
    Note: This plugin is a temporary workaround and should be used until this issue is addressed in Mac OSX 10.10 (Yosemite). Please remove this plugin once the issue is officially resolved by Apple.
    If you are using a stylus in conjunction with a trackpad, you might see issues with your trackpad. Workaround in this particular case is to use mouse instead of the trackpad.
    Hope this helps!
    Regards,
    vaishali

  • Problem with Color conversion ADM_Color to  AI_Color

    Hello friends,
    I think this is going to be the first post in this "Illustrator SDK Forum".
    I am having problem with 'Setting Art Work Colors'.
    I am trying to get the color value from the user through a ADM dialogue window, using the function
    sADMBasic->ChooseColor();
    The function is returning color in
    ADMRGBColor structure, whose members (
    red, green, blue) are of the type
    'short'.
    Now, I want to print a rectangular box art filled with that 'user selected color'.
    But the color I have with me is in the
    ADMRGBColor(each member of type 'short') and to draw that on a illustrator file, I need the type
    'AIThreeColrStyle'(each member is of the type AIReal).
    I had no idea how to convert
    ADMRGBColor to
    AIThreeColorStyle, but after lots of 'trial and errors', I arrived at this 'crude' solution.
    ADMRGBColor value was in the range
    0-65535 and
    AIThreeColorStyle was in the range
    0-1
    aiPathStyle.fill.color.c.rgb.red = ((float)admColor.red)/65535;
    This conversion was working fine on Windows, but on Mac its giving weird results. Can some one tell me the proper solution for this conversion problem?
    Thanking you,
    Vijoy~
    And thank you Adobe for givig us this "Illustrator SDK Forum".
    Forums Operations "Why there is no SDK forum for Illustrator?" 12/13/04 4:21pm

    The code above seems to work for me. I get the proper values in the rgb fields of the AIPathStyle struct. Are you sure you are filling in the remaining values in the struct (like fillPaint, overprint, etc.) with appropriate values?
    Hope that helps,
    -Frank

  • Photoshop CS 6 - image -canvas - make double matt - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Photoshop CS 6 - image -canvas - make double matte - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Hi, The options bar shows sample size 101 by 101 Average. That was my problem. When I was troubleshooting in order to try to explain to you what was happening, I noticed that when I sampled my models teeth, it gave me a color a bit lighter than her lipstick as my foreground color in my tool box. That started me thinking in the correct way. I didn't realize that my sample size had somehow gotten switched from point sample to 101 by 101 average. I appreciate the help. Thank you.

  • Selective Color panel is unavailable (greyed out) in PS CS5

    Hi!
    I've had this problem occur in previous versions as well.
    I work on an image and use Selective Color to make adjustments, then, out of nowhere, the panel no longer operates.
    I can no longer select the colors from the drop down menu for adjustments because the menu is grayed out...here is a photo to demonstrate...
    Do any of you know why this is happening?
    Thanks!
    ~LA

    I know this is old, but in case you come across it again this is one fix that works about 75% of the time.
    Edit>Preferences>General>Reset All Warning Dialogs.'
    Jeremy

Maybe you are looking for