nikolaydymura / flutter_image_filters

MIT License
28 stars 13 forks source link

Is it possible to modify the configuration parameters to achieve silky rendering filters? #29

Closed jiangchengze closed 6 months ago

jiangchengze commented 7 months ago

static Future<Uint8List?> brightness(Uint8List imageData,double value) async { final texture = await TextureSource.fromMemory(imageData); final configuration = BrightnessShaderConfiguration(); configuration.brightness = value; final image = await configuration.export(texture, texture.size); final bytes = await image.toByteData(format: ImageByteFormat.png); return bytes?.buffer.asUint8List(); } I want to modify the value through Slider to achieve a silky filter effect, but the UI is very laggy. Is there any good way to achieve it?

nikolaydymura commented 7 months ago

@jiangchengze there is specific widget for making live preview https://github.com/nikolaydymura/flutter_image_filters?tab=readme-ov-file#imageshaderpreview-example

or view this repository https://github.com/nikolaydymura/image_filters_example . It's a big sample of all our packages.