What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Removing background image in batch


Hubba88

New Member
Messages
3
Likes
0
Hi, i have a large number of pictures, they all have the same background image.

The background image is a white-to-gray vertical gradient and has some text on the top.

I created an action to batch remove the background - I use color ranges (Select the Rectangular Marquee Tool and the Right Click anywhere on the image and click on 'Color Range')

In the Color Range dialogue i selected 'Add to Sample' and started clicking numerous times along the horizontal line of my background - I am reminding you that my background is a gradient.

After selecting all of the colors (samples) that are in my background I clicked 'OK' and deleted the selection which leaved me with my image and a transparent background - GREAT!!

This method works great if my image has a high contrast with the background - which is about 80% of the cases.
When i use this action to remove the background from images that have WHITE / GRAY colors in them it comes out terrible since the Color Range selects the background AND bright areas on my image and deletes them.

Does anybody know how i can tackle this problem?

I have came up with an idea which i don't know how to execute:
I have the background image saved as a separate file, I want the Batch Action to check the original background image against all of my images and:

-Detect which parts of the image are similar to the original background
-Delete those similar areas

If that is possible, that would probably be a pretty good way to get rid of the background without deleting anything from my image.

Is it possible to do something like that in Photoshop (maybe using masks?!), or is it possible with any other Image Editing Software?

I will be more than happy to hear other opinions and suggestions as well.

Thanks!
 

mattattack347

Power User
Messages
401
Likes
77
Well this might be as easy as opening up photoshop doing the same thing exept unselect the bright areas in your image.
Then doing the same thing.
:D
 

SCTRWD

Power User
Messages
457
Likes
239
I have came up with an idea which i don't know how to execute:

I have the background image saved as a separate file, I want the Batch Action to check the original background image against all of my images and:

-Detect which parts of the image are similar to the original background
-Delete those similar areas

If that is possible, that would probably be a pretty good way to get rid of the background without deleting anything from my image.

Of course, it's possible, but wouldn't solve your problem: if your image and background happen to have similar parts they will be deleted too:lol: The very same way it happened in your Color Range try.

In general, it's not possible unless you also have the same image on the comletely different background. Then you could restore the actual image values even with semitransperancy.

In your case just put original background on one layer, the image with backrgound on the other with Difference blend mode. Make Threshold adjustment layer with Threshold level 1. Get your mask.

Or you can put both layer in Smart Object and try some stack mode.
 

Hubba88

New Member
Messages
3
Likes
0
In your case just put original background on one layer, the image with backrgound on the other with Difference blend mode. Make Threshold adjustment layer with Threshold level 1. Get your mask.

Or you can put both layer in Smart Object and try some stack mode.

Ive never used smart objects so i don't really know what to do with them :)

I tried the other method using the 'Difference' blending mode and it seems to work pretty good.
I Added a Threshold '1' and it looks like it masks all the correct parts of the image.
Can you please tell me how to take that mask and use it on the original image so i will be able to show the original image on a white background?

Thank you very much for the help BTW!!
 

SCTRWD

Power User
Messages
457
Likes
239
Just press Ctrl+Alt+2 and apply this selection as a mask to image layer.
 

Top