vote up 4 vote down star
2

In Photoshop, I've put together some panorama photos using the Photomerge tool and the resulting image contains a lot of transparent pixels. Also, because it's put together of multiple photos the alignment can be off. What I'd like to do is cut the image down to the largest box which contains no transparent pixels at all. It's similar to the Trim tool, but this would remove a number of non-transparent pixels. Is there anything like this?

Basically something which would automatically crop the above image to the selection box there: a rectangle with no transparent pixels.

flag

60% accept rate
Usually you can do a select-all on the layer and it will omit empty (transparent) pixels. – jweede Aug 12 at 11:54
yes, but i want to trim it to a rectangle which doesn't contain transparent pixels. i'll edit to clarify that. – nickf Aug 12 at 11:58

4 Answers

vote up 1 vote down

There are several different approaches I would take to this, but I can't think of a way to do it automatically.

First create a fill layer below with a bright colour. This shows you any semi-transparent pixels left from merging images.

Secondly, duplicate the top layer with your image. keep duplicating your original picture layer until any colour from the fill layer below has vanished. This has the effect of making any semi-transparent pixels completely opaque, and doesn't affect the rest of the image as it already is.

Last, merge all these layers and crop to the desired size. You could crop at the beginning if you wanted to, it makes no difference.

If a given pixel area has no fill, rather than crop it, why not clone over it with the clone tool?

link|flag
vote up 1 vote down

Just in case photoshop does offer you no solution for this:

I use Microsoft ICE or Autopano Pro for photo stitching, and they both have very simple to use crop features to achieve just this.

Maybe you should try to use a different tool for stitching - ICE is free of charge, might be worth a try.

link|flag
I've found no good choice for stitching other than Photoshop. It's simply awesome... I opened 2 docs containing a scanned in image set a few settings in a dialog and let it work, perfectly stitched them together! – RCIX Jan 2 at 9:33
vote up 0 vote down

What I can think of is:

a) Photoshop scripting [1 2]

b) Matlab [3]

Have a look. Meanwhile, I'll look for links that explain better how this can be done or probably write some Matlab code for this and then edit this post.

link|flag
vote up 0 vote down

If you can't find an automatic tool and have to end up doing it by hand, this tutorial will show how to do it with the single-row marquee tool which is a lot easier than the regular one when trying to get right at the top.

link|flag

Your Answer

Get an OpenID
or
never shown

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