82128746 d4f76500 97d6 11ea 98f8 6f558d5c5a08
82128746 d4f76500 97d6 11ea 98f8 6f558d5c5a08


Pixl is an image manipulation library with the power of RenderScript, which is faster than other common solutions. It currently contains three basic scripts: brightness, contrast, and saturation.

Screenshots

installation

Add Jitpack to your build.gradle project file

 allprojects { repositories { ... maven { url 'https://jitpack.io' } jcenter() }
}

}}

Then add this dependency to your app build.gradle file.

 dependencies { implementation 'com.jibraniqbal.pixl:pixl:0.0.1'
}

use

You can see the example with brightness, contrast and saturation with search bar at a value of 0-100%

Add support for API-19 Add this to build.gradle

android { defaultConfig { ... renderscriptTargetApi 19 renderscriptSupportModeEnabled true }
}

Initialization

 val pixl = Pixl(context)

brightness

 brightnessSeek.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) { val input = originalBrightnessImage val output = Bitmap.createBitmap(input.width, input.height, input.config) pixl.setBrightness(input, output, p0?.progress?.toFloat() ?: 0f) postImage(brightnessImage, output) } override fun onStartTrackingTouch(p0: SeekBar?) {} override fun onStopTrackingTouch(p0: SeekBar?) {} })

contrast

contrastSeek.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) { val input = originalContrastImage val output = Bitmap.createBitmap(input.width, input.height, input.config) pixl.setContrast(input, output, p0?.progress?.toFloat() ?: 0f) postImage(contrastImage, output) } override fun onStartTrackingTouch(p0: SeekBar?) {} override fun onStopTrackingTouch(p0: SeekBar?) {} })

saturation

 saturationSeek.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) { val input = originalSaturationImage val output = Bitmap.createBitmap(input.width, input.height, input.config) pixl.setSaturation(input, output, p0?.progress?.toFloat() ?: 0f) postImage(saturationImage, output) } override fun onStartTrackingTouch(p0: SeekBar?) {} override fun onStopTrackingTouch(p0: SeekBar?) {} })

License

Copyright 2020 Jibran Iqbal

Any person who receives a copy of this software and the associated documentation files (the “Software”) is hereby granted permission free of charge to use the software without restriction, including, but not limited to, the rights to use, copy, modify, merge , publish, distribute, sublicense and / or sell copies of the software and allow persons to whom the software is made available to do so under the following conditions:

The above copyright notice and this permission notice are included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED “AS IS” WITHOUT ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING THE WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT WILL THE AUTHORS OR COPYRIGHT OWNERS BE LIABLE FOR CLAIMS, DAMAGES, OR OTHER LIABILITIES, WHETHER CONTRACT, TORT OR OTHER MEASURES, ARISING OUT OF, FROM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER OFFERS.

LEAVE A REPLY

Please enter your comment!
Please enter your name here