LOMO Filter LOMO is a concept that emphasizes feelings, opportunities, and weakens photography techniques. Uncertainty and randomness are the biggest characteristics of LOMO. LOMO originated from Lomography, the LOMO camera, which was originally a product of the Soviet Union and was manufactured by the Leningrad optical and mechanical alliance in 1980. It is a dumb camera created for the public's needs. Common lomo photo compositions have no rules, rich colors, inaccurate focus, inaccurate exposure, and shaking paste. LOMO has a variety of styles. This article briefly introduces a style. The specific Algorithm Implementation is as follows: 1. Use the "soft light" layer to mix source image A with source image. The formula is as follows: private int ModeSmoothLight (int basePixel, int mixPixel) {int res = 0; res = mixPixel> 128? (Int) (float) basePixel + (float) mixPixel-255.0f) * (Math. sqrt (float) basePixel/255.0f) * 255.0f-(float) basePixel)/255.0f): (int) (float) basePixel + (float) mixPixel + (float) mixPixel-255.0f) * (float) basePixel-(float) basePixel * (float) basePixel/255.0f)/255.0f); return Math. min (255, Math. max (0, res);} 2, B mixed with a style color set by yourself (such as blue: R-200, G-37, B-11, set the 40% transparency to Figure C. The formula is as follows: private int ModeExclude (int basePixel, int mixPixel) {int res = 0; res = (mixPixel + basePixel) -mixPixel * basePixel/128; return Math. min (255, Math. max (0, res);} 3, select a dark corner template and mix it with C to achieve the final LOMO effect. Of course, if you do not like the Bitmap effect, skip this step. The core code is private Bitmap LOMOFilterProcess (Bitmap src) {Bitmap srcBitmap = new Bitmap (src ); bitmap dst = new Bitmap (src); int w = dst. width; int h = dst. height; BitmapData dstData = dst. lockBits (new Rectangle (0, 0, w, h), ImageLockMode. readWrite, PixelFormat. format32bppArgb); BitmapData srcData = srcBitmap. lockBits (new Rectangle (0, 0, w, h), ImageLockMode. readOnly, PixelFormat. format32bppArgb); byte * pSrc = (byte *) srcData. scan0; byte * pDst = (byte *) dstData. scan0; int offset = dstData. stride-w * 4; int r, g, B; for (int j = 0; j Source image LOMO Filter Finally, put a complete C # DEMO download link: http://www.zealpixel.com/thread-66-1-1.html |