Picasso - transformation bitmap quality

匿名 (未验证) 提交于 2019-12-03 09:06:55

问题:

I am downloading low resolution pictures from web by using Picasso and displaying it in high res displays. Fetching images is straightforward:

Picasso.with(context)             .load(item.getPicture())             .transform(new BitmapTransformations.OverlayTransformation(                 context.getResources(), R.drawable.ic_play_video))             .error(R.drawable.picture_placeholder)             .into(target); 

Notice that I apply Overlay transformation into request - It's a high quality image asset I put on top of downloaded image. Applying overlay is also simple - just resize bitmap and put it in the center of image. But here comes the problem: Unless I add resizing, in my case:

.fit().centerCrop(); 

into Picasso request, overlaid high-res asset is copying quality of downloaded image (first picture). When I add this resizing before transformation the overlay looks as expected (second picture). Can anyone explain to me why this happens? Thanks you!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!