aryarohit07 / PicassoFaceDetectionTransformation

A memory efficient Android image transformation library providing cropping above Face Detection (Face Centering) for Picasso.
846 stars 98 forks source link

While load your picasso lib i got blurred images #5

Open VadivelChinnasamy opened 7 years ago

VadivelChinnasamy commented 7 years ago

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

charlizesmith commented 4 years ago

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

Have you got any solution

vanesca88 commented 1 year ago

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)