1
\$\begingroup\$

I'm helping to remove background from an image but am finding the edges of the foreground object are experiencing color cast more than other parts of the image. I've tried gimps white balance and it doesn't quite work. Any suggestions about how to perform color correction in specific parts of the image?

enter image description here Similar image is below (couldn't easily track back down the starting one) enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Color cast? Is it not just some remains of the original background? Was it red by any chance? Showing the original image might help. How did you remove the original background? And what software do you have available? \$\endgroup\$
    – MrUpsidown
    Sep 28, 2022 at 9:51
  • \$\begingroup\$ oh let me put that back in. There's some of if which is probably boundary blurring of plant and background, but the photo was also taken in a space which I think reflected some of the background light onto the plant because they were close to each other. I removed the background initially with this code github.com/DevinBayly/Allie_plant_segmenting/tree/… and I have gimp as a photo editing program and python for programming. \$\endgroup\$
    – Li Brary
    Sep 29, 2022 at 17:48
  • \$\begingroup\$ Ok, can I ask: Why did you mention Python and are you doing that for experimentation? If not... wouldn't it be easier to photograph the same subject(s) again in front of a black background? If you would give your question a bit of context, you might get more/better answers or ideas. \$\endgroup\$
    – MrUpsidown
    Sep 29, 2022 at 19:38
  • 1
    \$\begingroup\$ I mentioned the python stuff because the person I'm helping with this has about 1k images from different pine trees at different times. It seemed like a good start for automating background removal for the images. Black background material might have been the right initial move, I'm left to assume they had reasons they avoided that. Very true about the context, I could probably have expanded there but I figured I'd try to mock up whatever folks suggested as a python program if possible. I'll edit the initial post to suggest I'm operating on many images and am hoping to automate my approach.TY! \$\endgroup\$
    – Li Brary
    Sep 30, 2022 at 2:12

2 Answers 2

0
\$\begingroup\$

I would treat it as chromatic aberration.

I don't think Gimp has that function natively, but Darla's Purple Fringe removal script works natively in GIMP and is free... it might work well enough.

And there are other software that has the function... I used Adobe Camera Raw, but Raw Therapee also has good CA tools and is free.

I simply limited the purple fringe hue to the red side and set the amount pretty low... enter image description here

To do a much better job than that would require significantly better masking/selection to start with and might not be practical/possible.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for your answer! \$\endgroup\$
    – Li Brary
    Sep 29, 2022 at 17:51
0
\$\begingroup\$

The quickest way to remove the color cast is to replace the color Hue of the affected area.

Select the color and move the Hue slider to the right and it will replace the red with green. Bring down the luminosity of this adjusted color and you will have a match.

However, with a 1000+ images, this will be quite time consuming, but as you’re a coder, then consider scripting an automation tool in Python to do this or have a look at a plug-in called Bimp.

This method won’t give you complete edge to edge sharpness, but will get the job done at a more respectable pace.

I have reattached your file with the kind of result you can possibly achieve.

Please note, I have over applied the color replace just for demo reasons and you can keep this dialled down.

To achieve a better result, you may want to choose a lighter background color and then replace color from the outset and not punch the image out first onto black. this will reduce the jagged edges.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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