GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Intensity with GPUImageLookupFilter

Open maurrubio opened this issue 12 years ago • 5 comments

Hello, it would be possible to add a intensity variable in the GPUImageLookupFilter?

The idea is control how much of the end image will have the lookup filter applied. Alternatively if someone can help me to setup a code that uses the Alpha filter to mix the original image and the filtered image it would be great.

maurrubio avatar Mar 27 '14 07:03 maurrubio

What I would recommend is learning to make your own custom filter and shader that does this, it's really not too difficult.

travisweerts avatar Mar 29 '14 05:03 travisweerts

I tried to do it looking into the GL shader of the GPUImageLookupFilter code but I couldn't figure out how to apply the alpha channel only on the first texture image, could someone help me to progress further?

maurrubio avatar Apr 02 '14 04:04 maurrubio

gl_FragColor = mix(textureColor, vec4(vec3(newColor),1.0), mixTexture);

the "textureColor" is the original texture, and "newColor" is the LookupFilter result, and mixTexture is the Alpha value which is (0 ~ 1.0), you can think it as intensity variable.

Lotogram avatar Apr 05 '14 03:04 Lotogram

Thank you very much @Lotogram it worked well.

Maybe someone should consider to commit this setting to the main branch? I think it's quite useful.

Regards.

maurrubio avatar Apr 05 '14 04:04 maurrubio

I think this is a basic shader, and developers could add any filters as they like. Only need to learn more shader language. :-)

The GREAT GUPImage which Brad created, is the open platform which has possibility to add any effect/filter/function you can image it.

Thanks Brad for his GUPImage!

On Sat, Apr 5, 2014 at 12:43 PM, maurrubio [email protected] wrote:

Closed #1485 https://github.com/BradLarson/GPUImage/issues/1485.

Reply to this email directly or view it on GitHubhttps://github.com/BradLarson/GPUImage/issues/1485 .

Best Regards,

Shawn | Support Team | Lotogram Technology LLC,.

DISCOVER THE LIFE OF PHOTO.

Lotogram avatar Apr 07 '14 08:04 Lotogram