Skip to main content

adjkit 0.2.0 copy "adjkit: ^0.2.0" to clipboard
adjkit: ^0.2.0 copied to clipboard

A pure Dart codec for Adobe Photoshop Levels, Hue/Saturation, Selective Color, and Channel Mixer presets.

example/main.dart

import 'dart:io';

import 'package:adjkit/adjkit.dart';

/// Prints the settings of one Photoshop adjustment preset.
Future<void> main(List<String> arguments) async {
  final AdjPresetKind? kind = arguments.length == 1 ? AdjPresetKind.fromExtension(arguments.single.split('.').last) : null;
  if (kind == null) {
    stderr.writeln('Usage: dart run example/main.dart <preset.alv|ahu|asv|cha|blw>');
    exitCode = 64;
    return;
  }
  final AdjPresetFile preset = AdjDecoder.decode(await File(arguments.single).readAsBytes(), kind: kind);
  final String summary = switch (preset.settings) {
    PsLevels(:final List<PsLevelRecord> records) => 'Levels: input ${records.first.inputFloor}–${records.first.inputCeiling}, gamma ${records.first.gammaValue}',
    PsHueSaturation(:final PsHueSaturationValues master, :final bool colorize) => 'Hue/Saturation: hue ${master.hue}, saturation ${master.saturation}, colorize $colorize',
    PsSelectiveColor(:final bool absolute) => 'Selective Color: ${absolute ? 'absolute' : 'relative'}',
    PsChannelMixer(:final bool monochrome) => 'Channel Mixer: ${monochrome ? 'monochrome' : 'color'}',
    PsBlackAndWhite(:final int red, :final int yellow, :final int blue) => 'Black & White: reds $red%, yellows $yellow%, blues $blue%',
  };
  stdout.writeln(summary);
  preset.warnings.forEach(stderr.writeln);
}
0
likes
160
points
276
downloads
screenshot

Documentation

API reference

Publisher

verified publisherfocale-editor.app

Weekly Downloads

A pure Dart codec for Adobe Photoshop Levels, Hue/Saturation, Selective Color, and Channel Mixer presets.

Repository (GitHub)
View/report issues
Contributing

Topics

#photoshop #adjustments #presets #codec #file-format

License

MIT (license)

Dependencies

pscore

More

Packages that depend on adjkit