Plug-in Needed to Remove ‘Common’ Pixels between two layers

B
Posted By
BrettRachford
Jun 7, 2007
Views
1076
Replies
9
Status
Closed
Hello All,

I have been searching for a PhotoShop filter/plug-in for quite some time. Let me take a moment to describe what I need and hopefully you can supply me with some feedback.

Please keep in mind all of these images are static … nothing moves. So there’s no need to work in anything other than PhotoShop. As you know PhotoShop is a very powerful software so I think this can be attained. Another thing to keep in mind is that all images are computer generated … not taken with a digital camera. So the ‘common’ pixels (explained in the following paragraph) are identical in every image (or layer).

I have one image that we’ll refer to as the MASTER. In addition to the MASTER I have tons of other images that are identical with one exception … each of these ‘other’ images contain a few items not in the MASTER image. For example, lets say the MASTER image is a computer generated image of grassy field. Each of the ‘other’ images contain that identical grassy field except one of the ‘other’ images contains a beach ball right in the middle of the field. While the other may contain a palm tree. In a sense, I want to compare each of the ‘other’ images (one at a time) to the MASTER and remove (or convert) the ‘common’ pixels (to transparency). So the only thing that shows up is the beach ball or the palm tree.

Once all of the images are generated I’m going to use them in Adobe/Macromedia Flash file. Initially the MASTER image will appear, when the user clicks/selects a ‘beach ball’ button, the beach ball will appear … when the user clicks/selects a ‘palm tree’ button, the beach ball will disappear and the palm tree will appear.

My guess is I’m looking for something that will unleash the power of PhotoShop, allow me to compare two layers (MASTER to the ‘other’) and remove the ‘common’ pixels between the two images. This really seems like a fairly simple thing … given how powerful PhotoShop is.

Any suggestions?

Please advise at your earliest convenience.

Thanks in advance for all of your help.
Brett Rachford

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

BG
barry_gray
Jun 7, 2007
put your "other" image in a layer above the "master" set layer blending mode to difference then select the black/delete. Maybe??
JR
John_R_Nielsen
Jun 7, 2007
It sounds like a combination of difference mode and threshold is what you’re asking for.

But why are you generating the same backgroung over and over? Why not just generate the tree or ball seperately,and put them as seperate objects in Flash?
B
BrettRachford
Jun 8, 2007
Thanks for the advice guys.

Barry – would you mind elaborating a bit more? I’m a bit confused with … ‘select the black/delete’ comment.

John – the software I’m using is a high end deck design software. Offering the ability to display a number of different railings/decking color options. My goal is to develop a Flash application that will enable the user to make selections with the push of a button. Initially the MASTER deck will appear. When the user wants to change the color of the flooring … the button click will simply move to a different frame within Flash (which will display the new flooring option). Another example would be if the initial railing is brown and the user wants to see how a gray railing would look … select the gray railing button and that railing will be displayed.

I’ve developed in Flash for quite some time so that’s not the issue. It’s getting my hands on all of the images representing the flooring and railing options.

The idea is to start with the MASTER deck file. Then generate separate screen shots (or image files) for each of the flooring and railing color options (one at a time). Follow me here. All image captures/files will then be compared to the MASTER image.

So with all of that said … if I can get my hands on a plug-in that will allow the comparison to be made … although tedious – I’ll have no other option but to perform the task on each of the many image files. Hopefully this explains the reasoning or need behind the need to remove the ‘common’ pixels.

Please help me … I know PhotoShop has the power … it’s just a matter of tracking it down.

I truly appreciate your help. Thanks in advance.
JR
John_R_Nielsen
Jun 8, 2007
How about this:

Put your "Master" on the background layer, and all the "Options" on seperate layers above that.

Then, for each of the "Option" layers, run an Action that

Changes layer blending mode to Difference.

Loads the luminosity of the layer as a selection

Changes to Quick Mask Mode

Inverts the Quick Mask channel

Runs Threshold with a value of 255 on the Quick Mask channel

Returns to Standard Mode

Returns to Normal blending mode

Clears the selection

Deselects

Once you have the Action, you could add a script to run it through all the "Option" layers in turn.
MR
Mark_Reynolds
Jun 10, 2007
You dont need any plug-ins Brett. Photosop has various ways to analyse the difference between layers.

John Nielsen has given you one advanced way to make an ACTION that will seperate the differences in your "other" images into their own, surrounded by transparent pixels. This method first requires you to make a multiple layered file. (dragging all your images into the same file using SHIFT to make sure they are registered EXACTLY on top of each other)

There is another way without making a layered file…If your images are the same size (they have exactly the same pixel dimensions) there is a way using Apply Image and "subtract" math, but its quite complicated to explain if you are a beginner.
B
BrettRachford
Jun 10, 2007
Hi Guys –

John – Your idea sounds brilliant. I’m anxious to give it a shot. I’ll keep you posted.

Mark – All of my images (MASTER and OTHER) will be identical in size along with a high percentage of the pixels themselves. With that said, your method may take a little less time than John’s (preventing the need for a multi-layer file). Would you mind describing your ‘Apply Image and ‘subtract’ math’ method? Just in case I have difficulties with John’s method. I’m looking forward to trying your method as well as John’s.

I truly appreciate the feedback I’m getting. Thank you everyone for your generous support.

Thanks again,
Brett
MR
Mark_Reynolds
Jun 11, 2007
Actually Brett, Johns method is the quickest because its an automated method. It only requires you drag all the files into one document (holding SHIFT remember so they are centred). You dont have to set up a script to go through the layers one by one either, this can be automated too using "next layer". This is recordable in an action by holding the option (alt) key and using the left and right bracket keys []

I will explain the subtract method anyway (this can be actioned as well) but it means you have to do each file seperately.

•Open all your files including the MASTER document
• highlight the first document you want to compare with MASTER • duplicate the background layer (command J)
• go to image/apply image
• in this dialog, in the source drop down menu choose your MASTER file • leave layer and channel to their default settings
• for blending choose "subtract"
• for offset type "128". Leave scale at 1
• now you can see the image has turned grey in all the areas THE SAME as your master file. Press OK
• next step is to select those areas, I use select/color range with fuzziness set to Ø. You can also use the magic wand with a tolerance of 1, but this cant be recorded easily as an action.
• Invert the selection (command shift I)
• delete the current layer, but leave the selection active. • press command J again and then delete the background layer

You can of course record all these steps (starting from step 3) as an action so at the press of a single key it will go through everything. as far as Im aware I think this method is the only way to MATHEMATICALLY compare inages with total precision, no missed pixels, other methods use blend modes which are not perfect. The late Bruce Fraser made me aware of it on these forums!
B
BrettRachford
Jun 13, 2007
Hi Mark –

I just wanted to thank you for the wonderfully detailed instructions on how to attain the results I’ve been searching for. They work to perfection. I was so glad to read your final paragraph mentioning the fact that ‘THIS’ was the only way to precisely compare images with total precision. To attain the results required on my project precision is most definitely required – missing pixels is not acceptable.

As you stated – once an ‘action’ is set beginning with Step 3 – it only takes a matter of seconds for the process to run its course on each of the ‘other’ images.

Thank you so much Mark.

Brett
MR
Mark_Reynolds
Jun 15, 2007
It was the late Bruce Fraser who pointed me to that method, on these forums a few years ago.

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections