easy_lut 0.2.1 copy "easy_lut: ^0.2.1" to clipboard
easy_lut: ^0.2.1 copied to clipboard

Dart package to easily apply LUT for images. You can use LUT files with 1, 3 or 6 columns of data.

example/easy_lut_example.dart

import 'dart:io';

import 'package:easy_lut/easy_lut.dart';

void main() async {
  final imageData = await File('card_1.png').readAsBytes();

  final lutPaths = [
    'InverseLUT',
    '1DummyLUT',
    'LBK-K-Tone_33.cube',
  ];

  final easyLUT = EasyLUT();

  for (var path in lutPaths) {
    LUT lut;

    try {
      lut = await easyLUT.parseLUTWithPath(path);
    } catch (err) {
      print('ERROR: Skipped $path\n$err');
      continue;
    }

    final fileName = lut.title
        .replaceAll(' ', '_')
        .replaceAll('"', '')
        .replaceAll('(', '')
        .replaceAll(')', '')
        .replaceAll('-', '_');

    if (lut is ThreeDimensionLUT) {
      final lutBMP = easyLUT.convertLUTtoBMP(lut);
      await File('${fileName}_lut.bmp').writeAsBytes(lutBMP);
    }

    final newImageData = easyLUT.applyLUT(lut, imageData);

    if (newImageData != null) {
      await File('$fileName.png').writeAsBytes(newImageData);
    }
  }
}
1
likes
160
pub points
55%
popularity

Publisher

unverified uploader

Dart package to easily apply LUT for images. You can use LUT files with 1, 3 or 6 columns of data.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

image

More

Packages that depend on easy_lut