dart_lut 0.0.2

  • README.md
  • Example
  • Installing
  • Versions
  • 46

Dart LUT3D #

The library for working with LUTs.

License #

project under MIT license

Changelogs #

full changelog

Task List #

  • [x] Basic impl.
  • [x] Read .cube files
  • [x] Read another formats
  • [x] Store 3DLUT
  • [ ] Generate LUTs by expression
  • [ ] Verifying LUTs
  • [x] Applying 3D LUTs
  • [ ] Applying 1D LUTs
  • [ ] Optimize perfomance
  • [ ] Clean up code
  • [x] Trilinear interpolation
  • [ ] More tests
  • [ ] Documentation
  • [x] Publish to PUB

0.0.2 #

  • remove .fromFile(File f) factory

Instalation #

add dependency in pubsec.yaml

from pub.dartlang.org:

  dart_lut: ^0.0.2

latest from github.com:

      git: git://github.com/NiKoTron/dart-lut.git

Usage #

generic example:

import 'dart:io';

import 'package:image/image.dart';
import 'package:dart_lut/src/lut.dart';


  final lut = LUT.fromString(File('example.cube').readAsStringSync());
  await lut.awaitLoading();

  Image image = decodeImage(imageFile.readAsBytesSync());

  var lutedBytes = lut.applySync(image.getBytes());

  var imageLUT = Image.fromBytes(image.width, image.height, lutedBytes);
  var outputFile = File('out.jpg')..writeAsBytesSync(encodeJpg(imageLUT));

Sample results #

Photo by Caique Silva on Unsplash

image by Caique Silva LUTs: KURO B&W by David Morgan Jones, Arabica 12 and Lenox 340 by rocketstock

Photo by sean Kong on Unsplash

image by sean Kong LUTs: KURO B&W by David Morgan Jones, Arabica 12 and Lenox 340 by rocketstock


0.0.1 #

  • initial release

0.0.2 #

  • remove .fromFile(File f) factory


import 'dart:io';

import 'package:dart_lut/src/lut.dart';
import 'package:image/image.dart';
import 'package:args/args.dart';
import 'package:path/path.dart' as path;

void main(List<String> args) {
  final parser = ArgParser()
    ..addOption('lut-file', abbr: 'l', allowMultiple: false)
    ..addOption('in-img', abbr: 'i', allowMultiple: true)
        abbr: 'o', defaultsTo: './out', allowMultiple: false);


void _run(final ArgResults argResult) {
  for (var img in argResult['in-img']) {
    final imageFile = File(img);

    final lutFile = File(argResult['lut-file']);

    final lut = LUT.fromString(lutFile.readAsStringSync());

    lut.isLoaded.listen((data) async {
      Image image = decodeImage(imageFile.readAsBytesSync());
      final sw = Stopwatch()..start();
      var interp = InterpolationType.trilinear;
      var v = lut.applySync(image.getBytes(), interp);

      print('lut apply in ${sw.elapsed}');
      var image2 = Image.fromBytes(image.width, image.height, v);
      var outputFile = new File(
      print('output image write to: ${outputFile.path}');

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dart_lut: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dart_lut/dart_lut.dart';
Version Uploaded Documentation Archive
0.0.4 Dec 26, 2018 Go to the documentation of dart_lut 0.0.4 Download dart_lut 0.0.4 archive
0.0.3 Dec 19, 2018 Go to the documentation of dart_lut 0.0.3 Download dart_lut 0.0.3 archive
0.0.2 Dec 18, 2018 Go to the documentation of dart_lut 0.0.2 Download dart_lut 0.0.2 archive
0.0.1 Dec 17, 2018 Go to the documentation of dart_lut 0.0.1 Download dart_lut 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dart_lut/dart_lut.dart.

Health suggestions

Fix lib/src/lut.dart. (-0.50 points)

Analysis of lib/src/lut.dart reported 1 hint:

line 56 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
args ^1.5.1
image ^2.0.4
path ^1.6.2
test ^1.3.0