Fresco: Rounding image corners drops its quality

Created on 29 May 2019  路  7Comments  路  Source: facebook/fresco

Description

Setting the roundInCircle mode on SimpleDraweeView causes the image to drop in quality dramatically. I've read the article, but it doesn't provide the reasoning of why the image gets malformed.

Reproduction

The image itself is being set as fallowed:


<com.facebook.drawee.view.SimpleDraweeView
                android:layout_width="@dimen/icon_size"
                android:layout_height="@dimen/icon_size"
                app:actualImageResource="@drawable/a1"
                app:roundAsCircle="true"
        />

Solution

Glide library and the android internal method of rounding drawables (BitmapDrawable.cornerRadius) are somehow deal with the issue (see the screenshot with examples)

Additional Information

  • Fresco version: 1.13.0
  • Platform version: Android 9, Google Pixel 3

Example

bug good first issue help wanted

Most helpful comment

Hello, it seems
.setPaintFilterBitmap(true)
in RoundingParams, which is false by default, fixes this issue
@ancientloregames can you check it in your project?

All 7 comments

There was one bug fixed with 6d3a538525d2eab10bd59400ee1fcaf9569bdf79, see #2293. That should fix your issue.

@oprisnik My colleague has assembled fresco from the master branch and the issue still exists

Example

Thanks for checking, that should not happen.

Bug still exists in fresco 1.14.0
It reproduces only on Android 9, at Android 8 and below it's fine
With OVERLAY_COLOR rounding everything is fine, it reproduces only with BitmapShader rounding

2293 is fixed in 1.14.0

Hello, it seems
.setPaintFilterBitmap(true)
in RoundingParams, which is false by default, fixes this issue
@ancientloregames can you check it in your project?

setPaintFilterBitmap should help if you use BitmapShader

Hi everyone! setPaintFilterBitmap(true) helps indeed, but the issue itself still exists in 2.0.0 even though the changelog says "Fix scaling up image with RoundingParams"

Update: Just checked the corresponding commit. So this flag is the solution for the issue. Then wouldn't it be more convenient to set make true by default?

Was this page helpful?
0 / 5 - 0 ratings