Open huunhan18pro opened 7 years ago
use “@beautify face 1 640 480 @blend mix watermark.jpg 100”
Thank you a lot.
Hi Wysaid, What filter will apply exactly color of watermark on photo? I use "@blend mix watermark.jpg 100" but look not good.
try "@blend addrev watermark.jpg 100"
Great. Thank you a lot.
@wysaid Looking at your demo.. I wish to apply multiple filters. Say for example, one from advanced and one from basic for brightness or something. How can I combine and execute them all together in final processing? Also I wish to retain the states of the filters applied to the image. So that the user, if required, can revert application of one of the applied filters. Guidelines?
@NHANNGUYEN92 / @wysaid Can anyone from you guide me on this..??? :
I wish to handle the intensities of both type of filters (Basic ones like Brightness, contrast, etc and Advanced one like any color filter ) together on single view (ImageGlSurfaceView
from the library).
Looking at the demo, the method for applying advanced filter is setFilterIntensity(float intensity)
but method for applying basic filter is like this.. seFilterIntensityForIndex(float intensity, int index)
. When I tried both using same methodseFilterIntensityForIndex(float intensity, int index)
on single config string like @adjust brightness 0.5 @curve***
where index
0 was for @adjust brightness
and index
1 was for @curve***
color filter. It simply didn't work.
Then I tried both the methods.. in case of advanced filter I called method setFilterIntensity(float intensity)
and in case of basic filter I called method but method for applying basic filter is like this.. seFilterIntensityForIndex(float intensity, int index)
. This time the logic simply misbehaved and the image was just turning into a mess of colors. Please help me on this.
Hi @Ashutosh-Tiwari The basic ones are the same with advanced ones if you created them by rule strings.
A wrapper is used for intensity adjusting by default(You can cancel this by adding #unpack
in front of the rule string). The wrapper will do a mix between the origin and the destination.
for example:
@adjust xxx1 @adjust xxx2
, this will generate a filter A, and the filter A is a filter wrapper, contains two filtersa1
anda2
. The filtera1
anda2
are the real filter.
setFilterIntensity
is setting the filter wrapper's intensity .
seFilterIntensityForIndex(intensity, index)
is setting the real filter's(a1
or a2
) intensity.
Hi Wysaid,
I have used this config: @adjust brightness 0 @adjust contrast 1 @adjust saturation 1 @adjust sharpen 0 @adjust lut aquaholic.jpg
Using this config, multiple filters work successfully. But when I save the filtered image, only lut filtered image is saved and not the one with applied brightness/contrast/saturation/sharpen.
How to save an image with all the filters?
@adjust brightness 0 @adjust contrast 1 @adjust saturation 1 @adjust sharpen 0
The rule above did nothing. So only the lut
is useful.
@adjust brightness 0 @adjust contrast 1 @adjust saturation 1 @adjust sharpen 0
this changes brightness, saturation, contrast, sharpen of the lut image. I referred to this link: https://github.com/wysaid/android-gpuimage-plus/blob/master/cgeDemo/src/main/java/org/wysaid/cgeDemo/BasicImageDemoActivity.java
But when I save the final image after changing all these effects together, the image saved is just lut image and with brightness, saturation, contrast, sharpen filters on it.
You should know, @adjust brightness 0
the brightness value is 0
. It's nothing.
The BasicDemo
has a slider to change them
Even if I pass any other value like @adjust brightness 0.9
, then also it doesn't work.
Even I have a slider to change values for all 4: brightness, saturation, contrast, sharpen. I can see the effects on image when I change the values using onProgressChanged method of seekBar. But that changes are not seen in saved image.
Maybe you can reproduce your problem in the builtin demo, and give me a fork address. And I'll take a look for that.
Sure. I will share a demo build with you to have a look.
Hi @wysaid, "@beautify face 1 640 480", is "640 480" image size?, if it's image size so why we need them ?. Could you recommend me any refs to help me more efficient to explore image filtering concepts and technical? Thanks
@evichrock The size is not very useful since we can get the image size after image loaded. So you can modify or remove the size, and get the size in the filter.
I will do this later.
Hi @wysaid, thanks for replying me. I want to apply only blur or beautify filters only for my face (skin), so I have to custom filters and using face tracker to do that?
@evichrock
You can try that. Normally we just do a global blur&brighten.
Hi Wysaid, Can I apply multiple filters?
Example: Both