Image Filter art-methodology, filter-Methodology

Source: Internet
Author: User
Tags image filter

Image Filter art-methodology, filter-Methodology

Recently, I have summarized the filter development methods I know and shared them with you. Most of my knowledge comes from the internet. I will make a summary here.

The so-called filter is initially an additional lens installed in front of the camera lens to filter the natural light, used to achieve color and add effect. Our filter algorithm is also called a software filter. It is used to simulate most lens filters. Of course, the error is inevitable. Our aim is to approach it infinitely. This is also the reason why we cannot reproduce the real shooting scenario, restore the information not contained in the photo, and thus it is difficult to achieve certain special filter effects, such as reflectors and ultraviolet filters (UV) and so on.

The current implementation of a software filter effect can be summarized as follows:

1. Basic Transformation

This is the first step of the filter effect. We can design various image effects based on our preferences. The following formula can be used for all the image effects:

F (r, g, B, a) = f (r, g, B, );

This formula contains four transformations, namely, the transformation of the RGB three components in the RGB color space and the transformation of the transparency Alhpa. Here we are short for the transformation of.

For example, the F-f transformation is as follows:

F (r) = B * 0.114 + g * 0.587 + r * 0.299;

F (g) = B * 0.114 + g * 0.587 + r * 0.299;

F (B) = B * 0.114 + g * 0.587 + r * 0.299;

F (a) =;

This grayscale is also a basic transformation. With this basic transformation, the image has achieved certain results. However, some complicated filters are not simple basic transformations, but some complex effects are superimposed, so there are the following steps.

2. Shadow material template superposition

When we open the Instagram app, we will find that many effects are shadow, mainly manifested in the four corners of the image, which are normal or bright in the middle, this is actually the reason for adding a certain amount of materials. Here we will introduce the classic dizzy corner material template in Instagram, as shown in:

How can we overlay materials like this? Here we will use some overlapping algorithms, the most common of which is the hybrid layer Algorithm in Photoshop. I have introduced these algorithms in my previous blog. You can study them carefully, in this step, we use these hybrid layer algorithms to mix the material template and the first step of the basic transformation to get a variety of dizzy effects. Of course, these hybrid algorithms are not unique. You can try to design your favorite hybrid layer algorithms.

The link http://blog.csdn.net/trent1985/article/details/40891661 of Photoshop hybrid layer algorithm is given here.

3. Style template superposition

The style overlay here is similar to the material overlay Algorithm in 2. Here is a major step problem. For example, in order to achieve the effect of the old photos, we will first use the basic color change, it can achieve the yellowing Effect of old photos, but it is still not realistic, because old photos often have some image noise and crack. If your algorithm cannot implement these effects, you can create a template by using PS and stack the template to the image to achieve more realistic results.

4. Photo Frame template superposition

With 1-3 steps, a filter effect is basically completed, but sometimes you want to be more beautiful, then you can use PS to make some exquisite Photo Frame templates, isn't it more beautiful to overlay the filter effect?

The above four steps are a filter development step. Of course, these steps are not necessarily required by a filter. They can be one or multiple steps. However, in the final analysis, the implementation of any software filter should not be able to escape these steps. As long as we have mastered these steps, after many attempts, we will always develop your favorite filter effect.

5. For the first step, we will introduce a quick implementation method:

For any filter, if there is a basic transformation step, we can use color ing to build a ing table and then use the table to quickly implement the transformation effect, this greatly improves the filter speed and user experience.

The basic principle of the color ing lookup method: record a corresponding ing target color for each color in a table. When you use the ing method to map the color of a photo, you only need to traverse each pixel of the photo, find the target color corresponding to the pixel color in the table, and set the pixel as the target color. The premise of the lookup method is that the color ing has nothing to do with the surrounding color, that is, a color, regardless of the surrounding color or the location of the photo, the target colors must be the same.

For example, the number of colors that RGB can represent is256*256*256 = 16,777,216If you want to record the ing results of each color, the color table requires more than 16 million records, which obviously cannot be applied to the actual project. For the sake of simplicity, levzelensky has published a baseline color table, storing each of the four similar colors in one record, so that the color table only needs64 * 64 * 64 = 262,144Records. The table is as follows:

Note: In the table above, 262,144 colors are divided into 8 blocks, each of which64 * 64The color of each grid is different. When performing color ing, first use the digital image processing software to apply a simulated filter to the baseline color table to generate a ing table (for example), and then for each pixel of the photo to be processed, find the position of the pixel color from the base color table, and then obtain the target color from the corresponding position of the ing table.

With this method, your filter speed can be greatly improved.

The above five steps are part of my summary based on network resources and personal information. If you like filter development, you can try them.

Finally, we will introduce how to crack the 10 thousand filter:

For a filter, we create a template. The size of this template is customized and you can see the filter effect. For example, Instagram, the image size specified by this template is 530*530, then we construct a 530*530 blank template image. If we want to crack the Hudson effect, we will analyze this effect, including not only basic changes, but also shadow, there are even gradient templates related to location. This is a difficult issue to crack. The following steps can be used to crack the template:

1. Construct 256 templates of 530x530 size, respectively, and fill in 0-colors, that is, grayscale colors;

2. process the Hudson effect of each template and obtain the corresponding ing template library. This Library also records all Hudson effect settings, including basic changes, shadow, and gradient;

3. For any 530*530 size original image, we only need to find the corresponding color and the corresponding pixel value from the template library in 2, then this value is the effect of Hudson;

If you think about whether this is true or not, you may lose something. This method can be used to crack any filter. However, the efficiency of the actually sacrificed filter can be considered, right?

Now, today's introduction is over. If you have any questions, contact me:

My mailbox dongtingyueh@163.com, QQ: 1358009172

 

 

 

 

Related Article

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.