Co-ordinates of selected pixels

Hi,
After selecting a group of pixels, is it possible to find out the co-ordinates of each pixel? I would also like to transfer these co-ordinates into another programme, is it possible to represent the co-ordinates in a script?

A filter can look at the selection in the form of a mask channel, so it's trivial to enumerate the pixels. Check SDK doc and sample code.

Similar Messages

  • Photoshop windows: Co-ordinates of each selected pixel

    Hi,
    I am using photoshop version sc3. After selecting pixels of a certain colour, is it possible to gain the co-ordinates of each selected pixel? Is this possible through using a script?

    Post your question in the 'Adobe Photoshop Developers (SDK)' forum.

  • Transformation - Rotate only moves path, not selected pixels.

    Hi All,
    I must be missing some simple click somewhere.... Just starting out with the Pen tool, paths and converting into a selection.
    Trying to transform a converted selection pixels made from a path.
    Current layer is visible and selected. Current path is selected. I use the path-selection tool to pick the path. I do "make selection" which turns pixels into a selection. So far, so good.
    After going to Edit | Transform Path | Rotate, the bounding box is displayed. I drag the corner and the bounding box turns along with the path I made. The selection does not move at all. When I hit the 'commit' button, no pixels are moved. Nothing changes in the picture.
    If I do all the above in an untouched fresh .psd file with just a background layer and a layer 1 included, everything works. Whatever is selected rotates fine.
    Why would a Transform Path | Rotate work fine in one photo, but not in another?
    I'm sure it's something simple. Thanks in advance.

    OK, found the solution in another forums.adobe.com post.... but it's non-intuitive.
    The "transform path" menu option instead of "transform" being displayed may have something to do with having multiple paths for an image. Not really sure. It's just a hunch.
    source:
    Opacity and Free Transform bugs
    solution text from sourced post (copied/pasted):
    Correct Answer by davescm on Jun 12, 2010 4:49 PM
    Ah with you now.
    With the selection on screen click on the Move tool. Then check the "Show transform tools"box at the top of the screen. After that transform away...
    I hope this helps
    Dave

  • Draw line between black pixel : coordinates of selected pixels ?

    Hi
    I want to build a script which can check a Photoshop file and :
    - find black pixel
    - for each black pixel, look for another black pixel within maximum distance of 5 pixels
    - then draw a line between the two black pixels.
    I wrote this script below (my first script ...), but it's VERY slow (and my final image is VERY big), I think because I test the colour for each pixel of the image.
    So another solution would be to first select black pixel with magic wand, then the script save all coordinates of selected pixels, then my script wil test only this pixels (less than 1% of the pixels are black in my image).
    Is it possible with JavaScript ?
    Thank you for your response !
    Marc
    function main(){
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var myHeight = app.activeDocument.height;
    var myWidth = app.activeDocument.width;
    // Find black pixel
    for(var i=5; i<myWidth; i++) {
      for(var j=5; j<myHeight; j++) {
       activeDocument.colorSamplers.removeAll()
       var sampler = activeDocument.colorSamplers.add([new UnitValue (i, 'px'), new UnitValue (j, 'px')]);
       if (sampler.color.rgb.hexValue === "000000") {
    // For each black pixel, search another black pixel below left up to 5 pixels
        for (var m=i-5; m<i; m++) {
         for (var n=j+1; n<j+5; n++) {
          activeDocument.colorSamplers.removeAll()
          var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
          if (test.color.rgb.hexValue === "000000") {
    // Then draw a black line between the two black pixels
           var FillColour = new SolidColor;
           FillColour.rgb.hexValue = '000000';
           var ad=activeDocument;
           ad.selection.select([[m,n],[i,j],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
           ad.selection.fill(FillColour);
           ad.selection.deselect()
    // For each black pixel, search another black pixel below right up to 5 pixels
         for (var m=i+1; m<i+5; m++) {
          for (var n=j; n<j+5; n++) {
           activeDocument.colorSamplers.removeAll()
           var test = activeDocument.colorSamplers.add([new UnitValue (m, 'px'), new UnitValue (n, 'px')]);
           if (test.color.rgb.hexValue === "000000") {
    // Then draw a black line between the two black pixels
            var FillColour = new SolidColor;
            FillColour.rgb.hexValue = '000000';
            var ad=activeDocument;
            ad.selection.select([[i,j],[m,n],[m,n+1],[i,j+1]], SelectionType.REPLACE, 0, true);
            ad.selection.fill(FillColour);
            ad.selection.deselect()
    main();

    The first alert should have shown the first pathPoint.anchors for all the subPaths in the path.
    The xyArray is just something I added for the alerts. The array 'myPathInfo' should have all the info extracted from the path.
    myPathInfo.length will tell you how many subPaths are in the Path.
    myPathInfo[index].entireSubPath.length will tell you how many pathPoints are in that subPath
    myPathInfo[index].entireSubPath[index].anchor will tell you the position of that pathPoint.
    The indexes start with zero.
    The bounding box of the entire subPath can be hard to work out just from the pathPoints. Unless all the point are corner points the path may extend beyond the anchors. One think you can do is create a new path from just one of the subPaths, convert by to a selection, and then get the bounds from the selection. You can make a new path from a subPath using the 'myPathInfo' array from above.
    app.activeDocument.pathItems.add("myPath1", [myPathInfo[0]]);
    That line will make a new path from the first subPath. Change the index to use a different subPath.
    Some other info that may help.
    app.activeDocument.histogram[0] will tell you how may black pixels are in the document. But its no help determining where they are. If that returns 0 there are no black pixels.
    If you don't have any luck working with converting the original color range selection into a path and need to go back to searching with the colorSampler it may help to use a grid approach. For example make a square selection, the size depending on how scattered the black pixels are, say 25x25px. Then use color range to select black. With an active selection it will only select pixels in that selected area( if any). You could then check to see if there is a selection. If not make another same size square to the right edge of the last area. If there is a selection, the solid property will tell you if more than one black pixel was selected( unless they are right next to each other ). If solid == true the selection bounds will tell you where the pixel is. If false you have to then search that square. But if there are areas where there are no black pixels checking a square range of pixels at once should be quite a bit faster than checking every pixel. And checking the historgram first will let you know if you should bother searching to start with.

  • Selecting Pixels based on a Blend Option

    I would like to select pixels based on a blend option— Multiply, Screen, etcetera— and I have yet to find out how to do this.  For example, I use the "Filter→Render→Clouds" effect, and I want to select pixels using the Screen effect so that white pixels will be at 100% opacity and black pixels will be at 0% opacity in the selection.  A plug-in would work as well.
    My apologies if this isn't the correct board for this type of thing.

    All right— I figured something out that works good enough.
    Here is a step-by step of what I did: [Note: Click on each image for a full-sized preview]
    First, make / open an image.  Make a backup copy if you opened an image.  I rendered a cloud effect.
    Select Image → Mode → Grayscale
    Open up the Channels window.
    Create a new channel, it will automatically make it an Alpha channel.
    Select the image and paste it into the Alpha 1 channel.
    Clear the "Gray" channel to 100% black [no transparentcy] and highlight Alpha 1 and click on the select button.
    Duplicate the main layer by dragging it to the new layer button and highlight the Gray channel and go to Select→ Save Selection
    Save it as a Mask and choose OK
    Next, to to Layer→ Layer Mask→ Apply
    And there you have it! White has 0% opacity, and black has 100%!
    If you wanted it to be reversed, as white has 100% opacity, and black has 0% opacity follow these steps:
    Right click on the icon of the layer, and choose Select Pixels
    Go to Select→ Inverse
    Make a new layer and hide the layer with the black.
    Fill that layer with white.
    Took me quite some time, but I figured it out.  I thought I would share it with anyone who needs to use it.

  • Selecting pixels on the outer edge of an item?

    When making a selection with either a lasso or Magic Wand, it seems to select the item, however, when I zoom in, there seems to be lots of soft pixels on the edges of the items that are not being included in my selection.
    What is the best way to get these outer pixels that have different colors and levels of transparency?
    Thanks!

    Those pixels may be only partly selected. A selection is just a mask, which is used to limit your edits to only he masked (or selected) area. If you, for example, fill a selection with white, you are just replacing the masked pixels with white. Some pixels can be partly selected, which would result in the white fill not being completely opaque. A 50% selected pixel would end up with a 50% white fill, effectively making it 50% less bright. For example, a red pixel (255,0,0) would become pink (128,0,0).
    Photoshop’s marching ants, as they have been called for decades, can only show whether an area either is or is not selected, it can’t show the level of selection. You can view the selection as a mask by pressing Q, invoking QuickMask. Now if you zoom into the edge of your selection you will see that those pixels near the edge are partly selected.
    If you don’t want partially selected pixels, then you can turn off Anti-alias in the tool options panel at the top of the screen.

  • How do I "Select pixels" on more than one layer, then "Paint bucket" ?

    Hi
    Using Photoshop CS4.
    I have a document with several layers.
    If I right click a layer in the "Layers UI" and then click "Select pixels" then the pixels in that layer is selected.
    Then I can use the "Paint bucket" to e.g. set another color for the selected pixels.
    Is it possible to "Select pixels" from more than one layer, and then use "Paint bucket" once to change color for all the selected pixels in one go?

    You wont be able to FILL more than one layer at a time.
    But loading seections can be done by holding control SHIFT and clicking on the layer thumnail in the layers panel. Each click will load more area depending on which layers you load

  • Moving, copying, and deleting selected pixels

    This question was posted in response to the following article: http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-76dba.h tml

    How can I completely remove selected pixels, so that there is NOT the background colour after pressing delete? I want the picture to become smaller by cutting away unneeded pixels... I already worked a bit with a regular Photoshop version a few years ago and I think there was a cutting tool which cut away the pixels without replacing them... but with Photoshop 5.0 it seems I can only select pixels and press "clear", but then the pixels are not gone, but replaced, which I do not want... how can I make them dissappear when working on a background layer? Yes, this is very basic, but sorry, I cannot find it out...

  • Selecting pixels in a picture and changing their color with a script

    Hi, I'm brand new to photoshop scripting, and I want to make a script that takes every pixel of a color and replaces it with a new color,
    I'm having the hardest time finding any information on the internet on how to do it though.
    I do have some background in other coding, so the concepts are not new, just the language and functions.
    I know there's tools and filters already, but I want to make a script so I can add features.
    Any help would be appreciated.
    Thank you!
    (P.S. Is there a way to open and read code of a pre-exsisting filter, or is that impossible?)

    To create your own filters you would need to download the SDK I think you might find an example of a filter.
    With Photoshop this might be close...
    main();
    function main(){
    if(!documents.length) return;
    var sColour =new SolidColor;
    sColour.rgb.hexValue ='245887';
    selectColorRange(0,sColour);
    try{
    var SB = activeDocument.selection.bounds;
        }catch(e){return;}
    var FillColour =new SolidColor;
    FillColour.rgb.hexValue = 'ff0000';
    activeDocument.selection.fill(FillColour,ColorBlendMode.NORMAL);
    activeDocument.selection.deselect();
    function selectColorRange( 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 );
    Using Christophs suggestion...
    //Use 1 pixel to colour
    app.activeDocument.colorSamplers.removeAll();
    var mySampler = app.activeDocument.colorSamplers.add([new UnitValue(1,'px'),new UnitValue(1,'px' )]);
    //Get original colour
    var oColour = new SolidColor();
    oColour = mySampler.color;
    app.activeDocument.colorSamplers.removeAll();
    //Select colour
    var sColour = new SolidColor();
    sColour.rgb.hexValue ='31618f';
    activeDocument.selection.select([[0,0],[1,0],[1,1],[0,1]], SelectionType.REPLACE, 0, false);
    activeDocument.selection.fill(sColour,ColorBlendMode.NORMAL);
    //Replacement Colour
    var rColour = new SolidColor();
    rColour.rgb.hexValue ='ff0000';
    activeDocument.selection.similar(0, false);
    activeDocument.selection.fill(rColour,ColorBlendMode.NORMAL);
    activeDocument.selection.deselect();
    //Replace original colour.
    activeDocument.selection.select([[0,0],[1,0],[1,1],[0,1]], SelectionType.REPLACE, 0, false);
    activeDocument.selection.fill(oColour,ColorBlendMode.NORMAL);
    activeDocument.selection.deselect();

  • Best way to select pixels in a low res image

    Hi,
    I need to trace the attached logo and make it white. I've tried selecting the pixels using the quick selection tool but it's very low res and even with some tweaks (removing and adding to the selection) its still not getting a good selection. What is a better and ideally fast way? Thanks!

    Hi,
    Is your logo a flattened image (only one layer)
    Or is the text on a separate layer from the white background?
    Could you post a screenshot including the layers panel?
    Something like this with the logo white on it's own layer

  • Selecting pixels on a layer using the magic wand

    PS CS5
    I have been trying to select individual pixels around a shape on a layer to create a mask to hide the semi transparent pixels but i cant seem to select individual pixels to add to the selection.
    In some places along the path of the object I have been able to select some individual pixels, but in other parts, groups of pixels automatically get selected or even the whole path is selected.
    How do i control this? I want to be able to only select the pixels i choose and not groups.
    The settings i am using are:
    Tolerance = 0
    Contiguous - Selected
    Sample all layers - Selected
    I have tried doing this with each of the following settings to no avail:
    New Selection
    Add to selection
    Subtract selection
    Intersect with Selection
    I was following a tutorial on the lullabots website to create a mask but can't reproduce the steps because of this problem
    http://www.lullabot.com/articles/creating-awesome-new-icon
    thanks in advance

    One setting that you haven't listed and which can affect the Magic Wand tool is the Sample Size.
    Activate the Eyedropper Tool, then right-click somewhere on your image.  Make the sample size Point Sample.  This will then tell the Magic Wand or any other tool that does an "eyedropper sample" operation to use the value of the single pixel you click on to gauge its operation.
    I mention this because the coupling is modal and sometimes overlooked.
    -Noel

  • Can't select pixels in channels

    I'm currently using photoshop cs2 and I can't seem to get it to select the pixels in my Channels. I used to be able to do this,don't know what's going on.Any ideas,maybe a setting got changed ?

    What operating system are you using?
    You can Ctrl or Command click on any of the channel thumbnails in the channels palette to load a selection of that channel
    Or use the keyboard shortcuts shown to the right of the channel names.

  • Opening an image in Photoshop CC, and select pixels with any method, the image starts to blink

    The entire image is what is blinking, while the photoshop tools remain on.

    I actually figured out that just changing the resolution of the screen fixed the problem.  The screen resolution had to be different from what it was.  Both lowering and raising it fixed the problem.  Strange.

  • Magic Wand Selection Tool Fails to Operate on Precise Pixel Color

    I had an interesting thing happen with Photoshop CS5...  My Magic Wand tool got to where it wasn't selecting pixel colors based on the one under the tip of the tool when clicked.  It was selecting what seemed like similar colors, but its operation wasn't really predictable.
    It turns out that in a prior unrelated operation (days ago) I had changed the color picker to look at a very large number of pixels when sampling.
    Having chosen the above, the setting was sticky and modal (meaning it subsequently affected samples taken from then on by a variety of tools).
    I didn't think that this should affect subsequent samples taken with the Magic Wand tool.  I'm not sure this has always been the case, but it doesn't seem as though it should work this way.
    Notably I don't see any way, while the Magic Wand tool is active, that the above sample size can be changed.  Nor did Resetting the Magic Wand tool correct the situation.
    Should the previously selected color picker sample size actually affect the Magic Wand tool, or is this a case where someone at Adobe consolidated the pixel sampling logic a bit too aggressively?
    If the latter, here's an adage to post in the halls of Adobe Engineering:  "Make everything as simple as possible, but no simpler."
    -Noel

    Hm, appears to be an old issue:  http://forums.adobe.com/message/3226358
    What I can't fathom is that it's never bitten me before.  I do tend to leave the eyedropper on 1 x 1 pixels, but I occasionally do sample larger regions.
    -Noel

  • Pixel Bender 32bit for CS5 crashes CS5 when I select the plug-in

    I am running Windows Vista Premium Home Edition SP2 on a Gateway Laptop.  I have 2gb of RAM and I have checked and my Video Driver is up to date.  I have un-installed all my other filters such as Topez and now running a clean version of CS5.  I also run CS4 on the same laptop as I am working on converting as I purchase upgrades to my other filters.  Pixel Bender runs file under CS4 but when I install it Adobe Extension Manager CS5 and then start CS5, load an image and then select Pixel Bender, it crashes CS5.
    I have deleted the download and down loaded it again.  I have looked through the forum and have not located a thread related to this problem.  Does anyone have any suggestions?
    Thank you.
    Michael

    What graphics card are you using? What are the driver date and version as displayed via Vista's Display preferences?

Maybe you are looking for

  • EBS 12.1.3 unable to restart after a successful installation

    Hi all, I've installed the EBS 12.1.3 template following the instructions in this guide: http://www.pythian.com/blog/build-ebs-sandbox-1hr. By the way, it's a charm not using VM Server/Manger... ;) Directly after the installation, I'm able to access

  • Web pages not displaying properly IE9

    Hello, Using Windows 7 32 Bit enterprise edition and IE9. Web pages are not loading properly but it works fine in Chrome and other browsers. Followed the below steps also. It did not help. Please let me know the other steps.  1. Click Start, type in

  • Scheduling Rman backup in windows

    Hi all, I need to configure backup in Rman using the task scheduler in windows. I have placed 2 scripts 1 is batch file and 2nd is sql file with the below contents. When i ran the batch file the process is only getting logged into RMAN prompt but not

  • Code asked for while downloading Adobe creative suite 6 Design Standard

    while downloading the Creative suite 6 i was aked for a code on the top left of the inside box ...doesnt seem to be one....is this  PNn umber on the adobe sticker on the end of the box. help!

  • Comiling vlc fails to build

    I'm trying to build vlc from ABS. makepkg failed with an error in vaapi. There is a commit in the vlc-git repo that seams to fix this, so i got the latest source from git://git.videolan.org/vlc/vlc-2.0.git (342f1a7). Now it fails to build with the fo