Skip to main content
Participant
February 17, 2021
Question

Removing background from multiple product shots

  • February 17, 2021
  • 5 replies
  • 2710 views

Hi

New website being completed and I have completed the somewhat boring task of photographing over 1000 bottles of wine. The website people have asked that I remove the background from the images and export them all as PNG files - is there a way to script/batch this process?

 

Cheers

Dan

This topic has been closed for replies.

5 replies

Stephen Marsh
Community Expert
Community Expert
February 18, 2021

Considering the quantity of images and their expected final display size likely being a thumbnail over a display image, I would look into creating an action similar to:

 

1) Select subject

2) Select contract: 2 or 3 px

3) Select > modify smooth: 4 or 6 px

4) Enter quickmask mode

5) Filter > noise > median: 20 to 40 px

6) Exit quickmask mode

7) Convert Background to layer

😎 Apply layer mask

9) Image > trim: transparency

10) File > automate > fit image

11) Resize canvas as required

 

Then batch to new files without overwriting the originals. You can also use Image Processor or Image Processor Pro scripts and possibly move resizing/fit image to the script rather than the action.

 

Steps and values are subject to taste/result after testing on multiple samples.

 

Select subject takes time. If you reduce the image size first, select subject can be a bit faster which may help when batching.

 

Good luck!

NY5E07Author
Participant
February 23, 2021

Thanks. Sorry for late reply! I'll be sure to test this suggestion out.

Dan

c.pfaffenbichler
Community Expert
Community Expert
February 18, 2021

There is one more potential issue: A clipped image may not work great when set against all backgrounds, so if it should be unpredictable which backgrounds the customer will use it may be advisable to decontaminate the edges.

Which would add to the time-factor. 

Bojan Živković11378569
Community Expert
Community Expert
February 18, 2021

As already suggested, tough stuff to easily automate your task. I ave tested using Automated Select Subject and using Magic Wand but none of options are giving perfect result. You can try to use blendin modes or some other techniques like Apply Image to make things easier for automated options and batch process, oterwise you will need some manual adjustment for perfect result without shadow.

 

Next time you will know how to shoot for batch bgr removal!

NY5E07Author
Participant
February 23, 2021

Franmkly, I hope to never have to do this again!! Once I can get this chunk of images done, I will only need to image new arrivals as they come in so far less stressful. Thanks for suggestions 🙂

c.pfaffenbichler
Community Expert
Community Expert
February 18, 2021

I am afraid the shadow (see screenshot) will make automation (Select > Subject, Magic Wand as per @JJMack ’s advice, …) difficult and all or most of the Masks may need manual amendment. 

JJMack
Community Expert
Community Expert
February 18, 2021

Select subject Invert selection clear  did this with your sample jpeg. I added a cyan layer to help you see the bottle edge and shadow

JJMack
c.pfaffenbichler
Community Expert
Community Expert
February 17, 2021

Please post sample images. 

 

Depending on the background it might be possible to automate (or semi-automate) the task. 

You could also check out http://remove.bg which might provide somewhat better results under certain circumstances, but at a cost. 

There are also other professional clipping services, some of which seem pretty cheap. 

NY5E07Author
Participant
February 17, 2021

Thanks for that reply. I have added some photos below. All the images have been taken at the same exposure etc.

NY5E07Author
Participant
February 17, 2021

actually none uploaded. perhaps raw files not allowed.