Android Camera Live Filter (i)

Source: Internet
Author: User

1, Android system will be built-in filter function

The filter feature has more than 20 different effects, not less than the effects of Instagram , the most popular smartphone app .

2. Color Matrix ColorMatrix

The color matrix is a 5x4 matrix that can be manipulated by the color matrix (ColorMatrix Class) in Android. It can be used to modify the values of the RGBA components in the image , and the color matrix is stored as a one-dimensional array as follows:
[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, p, Q, R, S, T]
He uses the Rgba Four channels to directly manipulate the corresponding color, if you will use Photoshop will know sometimes processing pictures by controlling the rgba Each color channel to make a special effect.

The effect of this matrix on color is calculated as follows:


The rule of the matrix is that a row of matrix a is multiplied by a column of Matrix C as a row of the matrix R .

The c matrix is the ARGB information contained in the picture , andtheR matrix is a new color component that is applied to C after the color matrix , and the result is as follows:


R ' = a*r + b*g + c*b + d*a + E;
G ' = f*r + g*g + h*b + i*a + j;
B ' = k*r + l*g + m*b + n*a + o;
A ' = p*r + q*g + r*b + s*a + t;

Ps: the 1th to 3rd column controls the hue, the 4th column controls the transparency, and the 5th column is the increment value of the component.

3, the basic filter effect implementation:

If we use ColorMatrix to adjust the proportion of RGB Three color, we can achieve such as monochrome, black and white effect.

4, Lomo Filter Effect of the implementation:

Change image value + mask

Android Camera Live Filter (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.