如何在安卓Java中使用GPUImageFilters编辑色调、饱和度和亮度?

huangapple go评论73阅读模式
英文:

How to edit hue saturation and luminance by using GPUImageFilters in android Java?

问题

我想使用OpenGLES或GPUImageFilter调整图像中特定颜色阴影的色调、饱和度和亮度。基本上应该是这样的:

如何在安卓Java中使用GPUImageFilters编辑色调、饱和度和亮度?

英文:

I want to ajust the hue, saturation and luminace of an image for specific color shades using OpenGLES or GPUImageFilter.

It should basically like this
如何在安卓Java中使用GPUImageFilters编辑色调、饱和度和亮度?

答案1

得分: 1

似乎这个库中没有内置的功能来实现这个。因此,你可以通过扩展 GPUImageFilter 并编写相应的着色器来自行实现。

你可以重用现有的色相、饱和度和亮度滤镜。
思路很简单 - 你要向着色器传递一个额外的参数(颜色)。基于这个颜色和当前像素的颜色,你可以选择是否让当前像素受着色器影响。

英文:

Seems like there's no built-in functionality for it in this library. So, you can implement it yourself by extending GPUImageFilter and writing a corresponding shader.

You can reuse existing Hue, Saturation, and Luminance filters.
The idea is simple - you're passing an additional parameter (color) to the shader. Based on this color and the color of the current pixel, you can choose if the current pixel should be affected by the shader or not.

huangapple
  • 本文由 发表于 2020年9月29日 11:56:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/64112661.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定