1

I'm trying to chromakey some pictures. Here is an example of one:

Picture of a vehicle

Here is another one,

Picture of a vehicle

Now using image magic, I can generate a mat like this..

enter image description here

But I can never get the mat to be "full". My plan is to create a static mat for the turntable and the lightbank -- those won't have to be removed. But, I'd like to fix the problems I'm seeing with the grill, licenseplate, and window. I'd like the car to show up pitch-black. I'm using ImageMagick's convert to get this working,

convert 1.bmp -channel g -separate +channel -fuzz 45% -fill black -opaque black -fill white +opaque black greenscreensample_mask_1.gif

How can I improve this to fill in the bumper of the vehicle?

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468

2 Answers2

2

I would guess the shinny parts are slightly green and you could try reducing the fuzz value.

Bonzo
  • 5,169
  • 1
  • 19
  • 27
0

You can use the -fx operator and then work with specific channels. The following is by no means optimal, and also, it is very inefficient to execute:

convert ./in.jpg -background none -transparent white -channel Alpha -fx '1-((g-r)+(g-b)+(g-(r+b)/2))^2' -channel Green -fx '(r+b)/2' ./out.png;eog ./out.png

in order to obtain a key for the green channel you can subtract the

  1. red from the green
  2. blue from green
  3. average of blue and red channels from the green channels

the very basic colour correction involves replacing fringed areas with the average of the blue and red channels, here however the entire image had its green channel replaced with the average of the blue and red channels. you should actually write an algorithm that seperates the fringe into a seperate channel, then you colour correct the entire image and mix it in with the original based on this "fringe" matt.

thankyou, best of luck

  • It is two commands. The `convert` command ends at `;`. The second command `eog file.jpg` just opens the file in a photo viewer. Replace eog with whatever file viewer you use. – 000 Jan 15 '15 at 21:33