PicassoFaceDetectionTransformation icon indicating copy to clipboard operation
PicassoFaceDetectionTransformation copied to clipboard

While load your picasso lib i got blurred images

Open VadivelChinnasamy opened this issue 7 years ago • 2 comments

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

VadivelChinnasamy avatar Jul 03 '17 12:07 VadivelChinnasamy

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

Have you got any solution

charlizesmith avatar Oct 11 '19 12:10 charlizesmith

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)

vanesca88 avatar Jul 21 '23 16:07 vanesca88