android-gpuimage icon indicating copy to clipboard operation
android-gpuimage copied to clipboard

How to remove the black background of gpuimage

Open TroyRay opened this issue 8 years ago • 7 comments

How to remove the black background of gpuimage?

TroyRay avatar Apr 26 '16 04:04 TroyRay

+1

JitenNumberTank avatar Jul 19 '16 06:07 JitenNumberTank

please

DzwsGo avatar Sep 22 '16 08:09 DzwsGo

it's my question too .

Hitexroid avatar Oct 13 '16 14:10 Hitexroid

My issue . Can anyone help me ? Thanks

thinhdt avatar Nov 06 '17 09:11 thinhdt

anyone found solution?

Seddiks avatar Feb 11 '18 21:02 Seddiks

??

tochange avatar Jun 23 '20 14:06 tochange

You can use set ascept ratio method on GPUImageView gpuImageView.setRatio(getDecimalEquivalent(bitmap.width,bitmap.height)) gpuImageView.setImage(bitmap)

private fun getDecimalEquivalent(width: Int, height: Int): Float { val factor = greatestCommonFactor(width, height) val widthRatio: Float = width / factor val heightRatio: Float = height / factor return widthRatio / heightRatio }

private fun greatestCommonFactor(width: Int, height: Int): Float {
    return if (height == 0) width.toFloat() else greatestCommonFactor(height, width % height)
}

milan15440 avatar Feb 14 '23 06:02 milan15440