Realization of positive film lamination effect in java image processing tutorial

preface

This article mainly introduces the method of how to realize the positive film stacking effect by using Java, and shares it for your reference and study. I won't say much below. Let's take a look at the detailed introduction together.

Positive overlay is a mixed mode in Photoshop. In short, it can fuse the contents of two layers.

The calculation formula of fusion is actually very simple, that is, a * B / 255. (A and B refer to layers A and b)

Another explanation is:

The red channel in layer a is multiplied by the gray scale value of each pixel corresponding to the red channel in layer B, and then divided by 255. Get a new red channel. The operation of blue and green channels is the same.     

Implementation method

In fact, the pixel gray scale value of a channel can be directly replaced by its corresponding RGB value. The following code is used to explain this process.

First encapsulate a method to obtain the corresponding RGB array according to pixels, which will be used later

Then the image pixels are traversed. The traversal process points are omitted and directly enter the processing stage

After you get the new pixel, you can directly set it to the new picture.

This method has been encapsulated by me and put into the toolbar images of Nutz (local download), which can be called directly. The following is an example of Nutz calling, which can be modified and used directly.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>