Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get direct Bitmap output #94

Open
noyize opened this issue Jul 19, 2019 · 4 comments
Open

Get direct Bitmap output #94

noyize opened this issue Jul 19, 2019 · 4 comments

Comments

@noyize
Copy link

noyize commented Jul 19, 2019

Is there a way to get the output as bitmap, rather than setting it directly to the ImageView.

@andj207
Copy link

andj207 commented Dec 27, 2019

For anyone is finding this feature. We can get direct bitmap like this:

val bitmap = Blur.of(context, sourceBitmap, BlurFactor().apply {
            sampling = downSampling
            radius = blurRadius
            color = colorOverlay
        })

@memishood
Copy link

memishood commented Feb 21, 2020

I invastigated the source code, i think it will not work without setting width and height.

BlurFactor factor = new BlurFactor();
factor.width = yourBitmap.getWidth();
factor.height = yourBitmap.getHeight();

//bitmap
Bitmap bitmap = Blur.of(context, yourBitmap, factor);
//drawable
Drawable drawable = new BitmapDrawable(getResources(),  bitmap);

@romanbsd
Copy link

romanbsd commented Oct 6, 2020

Unfortunately version 4.0.0 of blurry made the Blur and BlurFactor classes package private. I think that they should be part of public API, as we also use them this way to transform bitmaps w/o underlying ImageView.

@bes89
Copy link

bes89 commented Mar 26, 2021

Or at leat BitmapComposer should have a method to get the blurred bitmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants