cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
9k stars 2.27k forks source link

GpuImage Show Black background which is Transparent area #303

Open JitenNumberTank opened 8 years ago

JitenNumberTank commented 8 years ago

I have used this GpuImageView. I have tried to show Ic_launcher in that. I got image but transparent are converted into Black are. I have attached image here. How to remove this black transparent are and set Orignal transparent image.

screenshot from 2016-07-19 17 44 44

LaoMumu commented 8 years ago

I got the same problem too, ask for help.

DzwsGo commented 8 years ago

me too,help.

Hitexroid commented 8 years ago

please help !

TinchyIzzy commented 7 years ago

surfaceView.setZOrderOnTop(true);

gpuImage = new GPUImage(TestActivity.this); gpuImage.setGLSurfaceView(surfaceView);

setZOrderOnTop to true can be transparent

sorrybeman commented 3 years ago

same issue,ask for help.

shawndegit commented 2 years ago

anyone has solution now :(

monxarat commented 2 years ago

@JitenNumberTank You can set it some thing as below.

public class MyRenderer implements GLSurfaceView.Renderer {
@Override
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    gl.glDisable(GL10.GL_DITHER);
    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);

     gl.glClearColor(0,0,0,0);
     gl.glEnable(GL10.GL_CULL_FACE);
     gl.glShadeModel(GL10.GL_SMOOTH);
     gl.glEnable(GL10.GL_DEPTH_TEST);

...

public class MySurface extends GLSurfaceView {
....
    public MySurface() {
        setEGLContextClientVersion(2 or 3);
        setEGLConfigChooser(8, 8, 8, 8, 16, 0);
        getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
}

mMyRenderer = new MyRenderer(getContext(), MySurface);
shawndegit commented 2 years ago

@monxarat can u share us a complete demo :)