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

While load your picasso lib i got blurred images #5

Open
VadivelChinnasamy opened this issue Jul 3, 2017 · 2 comments
Open

While load your picasso lib i got blurred images #5

VadivelChinnasamy opened this issue Jul 3, 2017 · 2 comments

Comments

@VadivelChinnasamy
Copy link

I used your lib to detect face which is detected but image is completely blurred

@charlizesmith
Copy link

I used your lib to detect face which is detected but image is completely blurred

Have you got any solution

@vanesca88
Copy link

vanesca88 commented Jul 21, 2023

I noticed that too.
Better to use the same face detection-size, as the imageView itself. (to prevent blurring)
You also might want to leave out .fit and .centerInside
Leaving this here, so it helps someone.

Place this code somewhere in an activity, for example: onCreate()

val size = 500
val face = ImageView(this)
val params = LinearLayout.LayoutParams(size, size)
face.layoutParams = params
view.addView(face)

    Picasso.get()
        .load("https://static.wikia.nocookie.net/ladygaga/images/9/9a/Blackpink.jpg/revision/latest?cb=20200422160824")
        // .fit() // recommended for pure efficiency (but can make image look blurry/un-sharp/with artifacts)
        // .centerInside() // ditto
        .transform(FaceCenterCrop(size, size))
        .into(face)

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

3 participants