on_image_matrix

Pub.dev Platforms Flutter

on_image_matrix is a Flutter Package used to 'edit' basics aspects Brightness, Contrast, Saturation, etc... from a widget or image. Using OnImageFilters you can get some default filters.

Help:

Any problem? Issues
Any suggestion? Pull request

Translations:

NOTE: Feel free to help with readme translations

Topics:

How to Install:

Add the following code to your pubspec.yaml:

dependencies:
  on_image_matrix: ^1.0.0+1

TODO:

  • Fix bugs.
  • Add more [Features]

How to use:

OnImageMatrixWidget() // The main widget to start using the package.

All types of parameters on this plugin:

ParametersArgumentsDescription
blurdouble?Used to define the postion of effect based effectType.
blurModeTileMode?Used to define the postion of effect based effectType.
colorFilterColorFilter?Used to define the postion of effect based effectType.

To be able to save this widget as a image, use the builder.

OnImageMatrixWidget.builder() // The main widget to start using the package

All types of parameters on this plugin:

ParametersArgumentsDescription
blurdouble?Used to apply a blur effect on the widget/image.
blurModeTileMode?Used to define the blur mode.
colorFilterColorFilter?Used to define/apply the effect or filter.
controllerWidgetUsed to save, delete or get the widget bytes as image
imageKeyWidgetUsed to find the widget and convert into image
imageFormatdouble?Used to define format of widget when converting to a image .

Example:

OnImageMatrixWidget

OnImageMatrixWidget.builder(
  controller: _controller,
  imageKey: GlobalKey(),
  blur: 2.0,
  blurMode: TileMode.decal,
  // You can use some default filters
  colorFilter: OnImageFilters.gray,
  // Modifiy using your style
  // colorFilter: OnImageMatrix.matrix(
  //   brightnessAndContrast: 0.0,
  //   exposure: 0.0,
  //   saturation: 1.0,
  //   visibility: 1.0,
  // ),
  // Or create your own filter using color matrix.
  // OnImageMatrix.custom([
  //  1, 0, 0, 0, 0,
  //  0, 1, 0, 0, 0,
  //  0, 0, 1, 0, 0,
  //  0, 0, 0, 1, 0,
  // ])
  imageFormat: ImageByteFormat.rawRgba,
  child: Image.network(
  'https://source.unsplash.com/j0QOYiYwIYE/1600x900',
  ),
),

After modifiy you widget/image use the OnImageController to save it.

  OnImageController _imageController = OnImageController();

  Uint8List? saveImage() {
    _imageController.save();
    return _imageController.imageBytes;
  }

Color Matrix

Try yourself:

See more:

LICENSE:

Libraries

on_image_matrix