0

When I select all documents' transparent pixels by selecting a patch of transparent pixels outside a pixel object and putting Selection > Select Similar, then Selection > Inverse, it gives me perfect marching lines around my non-transparent object. However, when I go Ctrl+T to transform the said selection, there's some mysterious extra pixels in the transform box that are outside the marching lines. This messes up my automatic script I'm writing. Is there some simple solution I am overlooking?

I made sure the pixels were really "transparent" by doing a Clear after doing Selection > Select Similar. However, this had no effect on the mysterious extra space. But, if I dragged a marquee next to the object and 'delete' some of the extra space, it really does go away.

My goal is to use Selection > Select Similar to get the transparent pixels, then do the inverse and still have the selection transforming bounding box fit the marching lines if possible.

enter image description here

2
  • You have some low-opacity pixels which won't show the "marching ants".
    – Scott
    Dec 25, 2017 at 22:00
  • So it seems the marching ants do not represent the true boundary. I wish I could delete all pixels outside the selection, but this doesn't work because the selection I see is still not the right one. However, drawing with a brush draws in the marching ant zone. Therefore, I'd have to write in a bunch of extra junk to make a dummy layer and perform a color fill to get the accurate bounds.. but would this even work, maybe painting inside the marching zone actually also paints by a measure of tiny transparent pixels outside too. I'm going to make a test and check it out.
    – Silly-V
    Dec 25, 2017 at 22:18

1 Answer 1

1

You need to keep in mind that the marching ants is only a 1-bit visualisation of a selection and doesn't give you any visual indication of different levels (or opacity) of a selection. It's not an accurate representation of the selection.

Photoshop only includes anything that is more than 50% opaque in the marching ants. You can see this by making a selection from a layer with pixels all less than 50% opacity. You won't have any visible marching ants (although there will still be a selection) and you'll see a warning:

If you want a better visual representation of the selection you can enable Quick Mask mode. You'll see something like this:

Images taken from Photoshop Rectangular Marquee Tool not selecting correctly.

I suspect you just need to make your initial selection in a different way.

2
  • Very well, using the code for the magic wand tool (forums.adobe.com/message/2957356#2957356), I was able to circumvent this issue. Initially I thought that the select similar would be the most brief way to do this, but as it seems with all things photoshop, the script-listener code ends up needing used.
    – Silly-V
    Dec 26, 2017 at 17:01
  • Yes, it circumvents the issue to the capacity that it can: there are some pixels which I have located in those areas of the image which actually do not get even selected by a magic wand with 255 tolerance. Due to this, I'll just have to tell them that some files have this issue. Thanks!
    – Silly-V
    Dec 26, 2017 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.