How do I combine two monochrome images?
I need to write anaglyph images program . Let's say I have two monochrome images: red one and cyan one. How can I combine them into one to make an anaglyph image?
Please give me some advice. Thanks.
P / s: I am using C # program language.
+1
a source to share
3 answers
If the images are RGB, use the Darken blend mode. If they are CMYK use Lighten blending mode.
To darken, take a smaller value (Math.Min ()) of each channel. For ease, take the top one (Math.Max โโ()).
//Darken pseudocode
for(int y=0;y<CompositionBitmap.Height;y++)
for(int x=0;x<CompositionBitmap.Width;x++){
CompositionBitmap[x,y].R=Math.Min(RedBitmap[x,y].R,CyanBitmap[x,y].R);
CompositionBitmap[x,y].G=Math.Min(RedBitmap[x,y].G,CyanBitmap[x,y].G);
CompositionBitmap[x,y].B=Math.Min(RedBitmap[x,y].B,CyanBitmap[x,y].B);
}
}
+3
a source to share