Android各種各樣圖像濾鏡(圖像處理)效果: GPUImage for Android

GPUImage基于OpenGL實現的各種各樣圖像濾鏡(圖像處理)效果,多達50多種效果,idea源于GPUImage for iOS,基本囊括了最常見的圖像處理效果。包括:contrast,hue,gamma,brightness,sharpness,emboss,saturation,exposure,shadow,blend 等等。

由于需要用到OpenGL ES 2.0,所以,僅能在真機中測試。可以載入本地相冊的照片或者直接拍照后進行照片處理。

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity);

    Uri imageUri = ...;
    mGPUImage = new GPUImage(this);
    mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
    mGPUImage.setImage(imageUri); // this loads image on the current thread, should be run in a thread
    mGPUImage.setFilter(new GPUImageSepiaFilter());

    // Later when image should be saved saved:
    mGPUImage.saveToPictures("GPUImage", "ImageWithFilter.jpg", null);
}

項目主頁:http://www.baiduhome.net/lib/view/home/1389170927953

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!