Color Swap [RGB Channel Blending] [2012] :

GOAL: To "Combine two photos by mixing the color channels. Take multiple photos by changing lighting and/or other parameters (focus, exposure, time slot for motion). Then mix and match color channels to relight."

TOOLS + GADGETS: Camera: Canon T3i Lens: Canon EF 50mm f/1.8 II Standard AutoFocus Lens Image Processing: 3DS MaxScript

ORIGINAL SHOTS: Shots are done with two variations in mind: 1. Lighting + 2. Focal depth [note blurred background / foreground in the individual images]. Scene features various objects with different colors and reflective properties. The camera is positioned a little over a meter away from the scene. The mirror in the scene reflects the building across.

BLENDING PROCEDURE: Images are blended in pairs of two via bitmap processing and blending functions developed in MaxScript. Arguments determine: 1. Which of the RGB channels will be blended from each image 2. What the weight of blending from each blending will be 3. If the belnding will be done directly from the RGB levels or if there will be a multiplier to create deviation over the pixel plane. Each bitmap is saved with a file name indicating the parameters used:

KEY FOR IMAGE CAPTIONS: First two numbers indicate which images are picked for blending 63-41 The Numbers indicate the amplitude of RGB Channels read from each image: R1 R2 G1 G2 B1 B2 – for instance 0 1 1 0 1 0 would blend the RED channel from the 2nd image and GREEN BLUE channels from the 1st image. If there is any special case, it's indicated at the end of the caption



61-43-1_1_1_1_1_1 # the reflection of the building becomes clear. All channels from both images are read.

61-43-0_1_1_1_0_1 # same as above, green channels from both images, red and blue channels are read from different ones.

61-43-1_0_0_1_0_1 # same as above, channels swapped.

55-61-0_1_1_0_1_0 # two nighttime images are blended via reading different channels from the two images.

55-61-0_1_1_0_1_0-blueOnX # same as above, however the Blue Channel is manipulated by the X (lateral) position of the pixel on the canvas [left to right]

43-61-0_1_1_0_1_0-GdivY100-BdivX200 # a day and night time image are blended manipulating the GREEN channel with the Y (vertical) position and the BLUE Channel by the X (lateral) position of the pixel.

61-43-0_1_1_0_1_0-GdivY100-BdivX200 # exact same parameters as above, however the latter image is picked first

61-43-0_1_1_0_1_0-GsinX-BsinY # manipulating with Sin function

43-55-2_0_0_2_2_0 # same as above, using higher frequency

# finally a simple manipulation, to increase the amplitude of channels to have a brighter (over exposed) interior and visible exterior:

3DS Max Script: 

–code by onur yuce gun

fn Read_Bitmap BMPin =
local allPix = #()

for x=0 to (theBitmapWidth-1) do
allPix[x+1]  = #()
for y=0 to (theBitmapHeight-1) do
thePixel=getPixels BMPin [x,y] 1
allPix[x+1] [y+1]  = thePixel[1]
–print thePixel[1]
—-print allPix[2][2].r
return allPix

fn blendBMP val1 val2 Ramp1 Ramp2 Gamp1 Gamp2 Bamp1 Bamp2=
theBitmapDone = bitmap theBitmapWidth theBitmapHeight
for x=0 to (theBitmapWidth-1) do
for y=0 to (theBitmapHeight-1) do
locR = (val1[x+1][y+1].r)*Ramp1 + (val2[x+1][y+1].r)*Ramp2
locG = (val1[x+1][y+1].g)*Gamp1 + (val2[x+1][y+1].g)*Gamp2
locB = (val1[x+1][y+1].b)*Bamp1 + (val2[x+1][y+1].b)*Bamp2
setPixels theBitmapDone [x,y] #(color locR (locG*y/100) (locB*x/200))
fileNameHelper = Ramp1 as String +”_”+ Ramp2 as String + “_”+Gamp1 as String +”_”+Gamp2 as String +”_”+ Bamp1 as String +”_”+ Bamp2 as String
theBitmapDone.fileName =  theBitmap1.filename + fileNameHelper + “.bmp”
save theBitmapDone
print “DONE”