bluefireteam / bitmap

A Flutter package for manipulating bitmaps
MIT License
176 stars 34 forks source link

How should the parameters of the black and white filter be set? #25

Closed paintingStyle closed 2 years ago

paintingStyle commented 3 years ago

Thanks to the author for writing such a great library!

Drag the progress bar to make the picture whiter, I tried it, the effect is not good

  void updateFilterValue(value) async {
    if (_filterValue == value) {
      return;
    }
    _filterValue = value;

    Bitmap bitmap = await Bitmap.fromProvider(ExtendedExactAssetImageProvider('assets/images/photoShoot/ic_icon_editor_topic_example.jpg'));
    Bitmap brightBitmap = bmp.brightness(bitmap, value); // 位图亮度, 可以在-1.0和1.0之间。 0.0不执行任何操作;
    Bitmap nowThisBitmapLooksWeird = bmp.contrast(brightBitmap, 1.5); // 对比度 0~2.0的范围  default 1.0
    Bitmap finalBitmap = bmp.adjustColor(nowThisBitmapLooksWeird, saturation: 0); // 饱和度 0 1
    result = finalBitmap.buildHeaded();

    notifyListeners();
  }
renancaraujo commented 3 years ago

Could you be mroe descriptive on what the effect is not good means?

renancaraujo commented 2 years ago

Closing due to inactivity.