Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Separate/Select Different Grays
#1
I work in a small retail shop and take a lot of photos that involve "clear" packaging, and scans that have a natural gradient behind or through the product. There is a visual difference in the grays to the eye, but all manner of auto selects fail. Is there a decent way to get a hold of these backgrounds so I can white out or at the least normalize them? My goal is to utilize a "faster" method, because I can't spend too long on any given item. I am aware of limited masking and contrast tricks, but not seeming to find a good solution. Attached is one of the raw images I start with.    
Reply
#2
To compensate for the background gradient and get a 100% white background:

1) select a vertical strip over the whole height along one side of the packaging
2) copy to clipboard
3) Ad a layer on top and fill it with side by side copies of the strip. If your image is under 1000px high, this is quickly done: use the "clipboard" pattern and bucket fill the layer with the pattern. Otherwise you may have to manually copy (copy the copies: 1, 2, 4, 8, 16, 32...) or find a script
4) Set that filled layer to "Divide" mode. Your background will turn white everywhere. This can be enough if you just show this over a white web page.

   

Of course this processing blows up the whites in the original image. This can be corrected by deleting the "Divide" layer where you really want to keep the original picture: for instance make a feathered selection over the packaging and delete the matching contents in the "Divide" layer.

Also attached the XCF.


Attached Files
.xcfbz2   BackgroundNormalized.xcfbz2 (Size: 609.51 KB / Downloads: 263)
Reply
#3
Thank you so much! I actually modified this process slightly. I ended up using the "Color Picker Tool" on the top and bottom extremes of the greys, then the "Blend Tool" to create a approximate but smoothed layer. This eliminated some of the blow up in the white spectrum.    
Reply
#4
(01-20-2017, 09:34 PM)Perodin Wrote: Thank you so much! I actually modified this process slightly. I ended up using the "Color Picker Tool" on the top and bottom extremes of the greys, then the "Blend Tool" to create a approximate but smoothed layer. This eliminated some of the blow up in the white spectrum.

If you want to be even more accurate, there is this script that will create a gradient by sampling the color in multiple points along a path (your technique assumes that the gradient is linear...).

Unlike many similar questions I have seen asked here and elsewhere, you start with good material so editing isn't too hard.
Reply


Forum Jump: