Page 1 of 1

Extracting a reflection to overlay a banner

Posted: 2015-09-10T03:03:43-07:00
by michael.huber.1841
I have some real problems to extract a reflection from a given image. My goal is to overlay a banner with a solid color but keep the reflection intact. So my idea was to extract the reflection first to be able to overlay the reflection over the banner afterwards. As a result I want the image to look as realistic as possbile.

To reduce the problem, I created a minimalistic example with a car. As you can see, there are white reflections on the car.


To illustrate my problem I overlayed a banner in pure solid white color that obviously destroys the reflection.


So my goal is to have the reflection from the base-layer on top of the white banner. I already put a lot of effort into this problem without a perfect solution:

1) First I tried some different blend modes with the banner-layer. This approach doesn't work because the pure white of the banner (rgb 255,255,255) is almost the brightest color in the rgb-colorspace-model and adding color to white results in white. A possible solution should work with other solid colors too. For example the blend-mode "screen" (looks good with colors, but white doesn't work at all).


To make things as easy as possbile I already created the banner in different colors. ... agenta.png ... /black.png ... yellow.png ... ec2737.png

2) I tried to extract the reflection to overlay it over the banner afterwards. I transformed all dark pixels to transparent to eliminate the areas that are not part of the reflection. Pure black (rgb 0,0,0) becomes completely transparent, gray-pixels becomes half-transparent and so on... The result:


When overlaying this layer in normal-blend-mode, the result doesn't look very realistic:


Can anybode help me? Maybe with some improvements of my ideas or maybe even with some fresh ideas?


Re: Extracting a reflection to overlay a banner

Posted: 2015-09-10T09:22:27-07:00
by snibgo
When you photograph a white banner, the only part that will be pure white in the photograph will be specular highlights.

Windows BAT script:

Code: Select all

convert ^
  BaseCar.png ^
  ( +clone ^
    ( +clone ^
      -colorspace Gray +level-colors #088,#0ff ^
      carBlackBanner.png ^
      -compose CopyOpacity -composite ^
    ) ^
    -compose Over -composite ^
  ) ^
  -compose Lighten -composite ^
BaseCar.png is your photo of the car. carBlackBanner.png is your black banner.

For a white banner, change the "+level-colors" to #bbb,#fff or similar.