cats-oss / android-gpuimage

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

when set scaletype to CENTER_INSIDE,how to save filtered image with no black border? #519

Open whoami-I opened 3 years ago

whoami-I commented 3 years ago

Future Task

What is the motivation?

What kind of solution can be considered?

What do you want to discuss?

Please add relevant labels


Bug Reporting

Steps to Reproduce

Actual Results (include screenshots)

Expected Results (include screenshots)

URL

OS details

Please add relevant labels

whoami-I commented 3 years ago

for example ,this is original image c604f64e5ad5e060a5646ea97268e7b2 but the saved image is this one: 1615454953420

chirag-deshwal commented 3 years ago

In My case, I use ImageView in the layout file on the filter apply so to capture a Bitmap set bitmap into Image View.

When changing Image Change Gpuimage & ImageView at the same time

GPUImage filterLoader; ImageView view_filter;

// Inslize the View view_filter = findViewById(R.id.view_filter); // Form your layout file filterLoader = new GPUImage(this); // Just only in java code Not a child for any layout or View

//When filter apply change the Image filterLoader.setFilter(new GPUImageGlassSphereFilter()); // Set Filter

setImage(filterLoader.getBitmapWithFilterApplied()); // Capture bitmap

// Fill the Bitmap private void setImage(Bitmap fill) { view_filter.setImageBitmap(fill); filterLoader.setImage(fill); }