npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wmakeev/darkroom-xmp-tools

v2.0.4

Published

Retrieve and update darkroom operations params stored in sidecar xmp files

Downloads

18

Readme

darkroom-xmp-tools

npm Travis

Retrieve and update darktable operations params stored in sidecar xmp files. This helps automate image processing with darktable-cli

Install

Tested on: MacOS and Linux

$ npm install @wmakeev/darkroom-xmp-tools

Usage

Take some darktable XMP

...
<darktable:history>
  <rdf:Seq>
    ...
    <rdf:li
    darktable:operation="exposure"
    darktable:enabled="1"
    darktable:modversion="5"
    darktable:params="0000000040a0093bd8ce374000004842000080c0"
    darktable:multi_name="1"
    darktable:multi_priority="0"
    darktable:blendop_version="7"
    darktable:blendop_params="gz12eJxjYGBgkGAAgRNODESDBnsIHll8ANNSGQM="/>
    ...
  <rdf:Seq>
</darktable:history>
...

add some code

const assert = require('assert')
const { decodeExposureParams, encodeExposureParams } = require('@wmakeev/darkroom-xmp-tools')

// from XMP darktable:params
const EXPOSURE_PARAMS_BIN_STR = '0000000040a0093bd8ce374000004842000080c0'

let paramsObj = decodeExposureParams(EXPOSURE_PARAMS_BIN_STR)

console.log('exposureParams:', JSON.stringify(paramsObj))
// "exposureParams": {
//   "mode": "EXPOSURE_MODE_MANUAL",
//   "black": 0.0021000057458877563,
//   "exposure": 2.871999740600586,
//   "deflickerPercentile": 50,
//   "deflickerTargetLevel": -4
// }

// before encode you can modify paramsObj ...

let encodedParamsStr = encodeExposureParams(paramsObj)

// ... and update exposure darktable:params in XMP file with new value

assert.strictEqual(encodedParamsStr, EXPOSURE_PARAMS_BIN_STR)

API

Sharpen

  • decodeSharpenParams (encoded: string): SharpenParams

  • encodeSharpenParams (params: SharpenParams): string

Levels

  • decodeLevelsParams (encoded: string): LevelsParams

  • encodeLevelsParams (params: LevelsParams): string

Shadhi

  • decodeShadhiParams (encoded: string): ShadhiParams

  • encodeShadhiParams (params: ShadhiParams): string

Exposure

  • decodeExposureParams (encoded: string): ExposureParams

  • encodeExposureParams (params: ExposureParams): string

Blend

  • decodeBlendParams (encoded: string): BlendParams

  • encodeBlendParams (params: BlendParams): string

Clipping

  • decodeClippingParams (encoded: string): ClippingParams

  • encodeClippingParams (params: ClippingParams): string

Defringe

  • decodeDefringeParams (encoded: string): DefringeParams

  • encodeDefringeParams (params: DefringeParams): string

Flip

  • decodeFlipParams (encoded: string): FlipParams

  • encodeFlipParams (params: FlipParams): string

Basecurve

  • decodeBasecurveParams (encoded: string): Basecurve

  • encodeBasecurveParams (params: Basecurve): string

Common

  • decodeParams (operation: 'sharpen', encodedParams: string): SharpenParams

  • decodeParams (operation: 'levels', encodedParams: string): LevelsParams

  • decodeParams (operation: 'shadhi', encodedParams: string): ShadhiParams

  • decodeParams (operation: 'exposure', encodedParams: string): ExposureParams

  • decodeParams (operation: 'blend', encodedParams: string): BlendParams

  • decodeParams (operation: 'clipping', encodedParams: string): ClippingParams

  • decodeParams (operation: 'defringe', encodedParams: string): DefringeParams

  • decodeParams (operation: 'flip', encodedParams: string): FlipParams

  • decodeParams (operation: 'basecurve', encodedParams: string): BasecurveParams

  • encodeParams (operation: string, params: Params): string

Masks

  • decodeMaskPoints<MaskPoint> (maskType: string, numberPoints: number, encodedPoints: string): Array<MaskPoint>

  • encodeMaskPoints<MaskPoint> (maskType: string, points: Array<MaskPoint>): string

circle mask

  • decodeCircleMask (encodedMask: string): MaskCirclePoint

  • encodeCircleMask (mask: MaskCirclePoint): string

ellipse mask

  • decodeEllipseMask (encodedMask: string): MaskEllipsePoint

  • encodeEllipseMask (mask: MaskEllipsePoint): string

gradient mask

  • decodeGradientMask (encodedMask: string): MaskGradientPoint

  • encodeGradientMask (mask: MaskGradientPoint): string

Dependencies

TODO

  • Windows support?
  • Improve errors messages and arguments validation

Changes

2.0.2

  • Fix Typescript typings
  • Add Travis build

2.0.1

  • Add Linux support
  • Add some arguments validation
  • Fix some bugs