Nostalgic effects of special effects on Android Images

Source: Internet
Author: User

The image special effect processing series will introduce the special effect processing of image pixels. These materials focus on the principle. That is, as long as you knowAlgorithmYou can make the same special effects for C ++, VB, C #, and Java. The following describes the image nostalgia algorithm. The algorithm is as follows:

The above formula means that the RGB values of each pixel are separated first, and then the RGB values are re-calculated as the RGB values of the current vertex according to the preceding three formulas.

See the following:

Original Image:

After processing:

Code:

 

/*** Nostalgia effect (twice faster than the previous optimization) * @ Param BMP * @ return */private bitmap oldremeber (bitmap BMP) {// speed test long start = system. currenttimemillis (); int width = BMP. getwidth (); int Height = BMP. getheight (); Bitmap bitmap = bitmap. createbitmap (width, height, bitmap. config. rgb_565); int pixcolor = 0; int pixr = 0; int pixg = 0; int pixb = 0; int newr = 0; int newg = 0; int newb = 0; int [] pixels = new int [width * Height]; BMP. Getpixels (pixels, 0, width, 0, 0, width, height); For (INT I = 0; 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.