导包
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'jp.wasabeef:picasso-transformations:2.1.2'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
使用方法
mContext=this;
iv = (ImageView) findViewById(R.id.iv);
Picasso.with(this).load(pic_umr)
.transform(new MaskTransformation(this, R.drawable.mask_starfish))
.transform(new MaskTransformation(this, R.drawable.chat_me_mask))
.transform(new CropTransformation(300, 100))
.transform(new CropTransformation(300, 100, CropTransformation.GravityHorizontal.RIGHT,
CropTransformation.GravityVertical.CENTER))
.transform(new CropTransformation((float)0.5,CropTransformation.GravityHorizontal.RIGHT,
CropTransformation.GravityVertical.CENTER))
.transform(new CropSquareTransformation())
.transform(new CropCircleTransformation())
.transform(new ColorFilterTransformation(Color.argb(80, 255, 0, 0)))
.transform(new GrayscaleTransformation())
.transform(new RoundedCornersTransformation(30, 0,
RoundedCornersTransformation.CornerType.DIAGONAL_FROM_TOP_LEFT))
.transform(new BlurTransformation(this, 4, 5))
.transform(new ToonFilterTransformation(this))
.transform(new SepiaFilterTransformation(this))
.transform(new ContrastFilterTransformation(this, 2.0f))
.transform(new InvertFilterTransformation(this))
.transform(new PixelationFilterTransformation(this, 20))
.transform(new SketchFilterTransformation(mContext))
.transform(new SwirlFilterTransformation(mContext, 0.5f, 1.0f, new PointF(0.5f, 0.5f)))
.transform(new BrightnessFilterTransformation(mContext, 0.5f))
.transform(new KuwaharaFilterTransformation(mContext, 25))
.transform(new VignetteFilterTransformation(mContext, new PointF(0.5f, 0.5f),
new float[] { 0.0f, 0.0f, 0.0f }, 0f, 0.75f))
.into(iv);