Coder Social home page Coder Social logo

jpederson / node-transicc Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 5.0 20.54 MB

A nodejs wrapper for LittleCMS's transicc command line utility. Perform true ICC profile color conversions in your node apps! Used by multiple other node modules, and projects (like https://colorvert.com/).

Shell 3.38% JavaScript 96.62%
icc-profile javascript nodejs littlecms icc

node-transicc's Introduction

node-transicc

A simple nodejs module that wraps the LittleCMS transicc command line utility, to allow you to make true ICC Profile-based color conversions inside your node apps. The goal of this project is to enable accurate color conversions, like those achieved in most image editing programs - unlike pure math-based conversions (which fail in situations like using CMYK).


GitHub release npm


Installation

First, install LittleCMS using the commands below on Unix/Linux/OSX (binaries available for other OSs). It's a small, open source C-based color management system - transicc uses a LittleCMS command line utility by the same name to perform the actual profile comparisons.

git clone https://github.com/mm2/Little-CMS.git
cd Little-CMS
./configure 
make 
make check 
sudo make install

Next, you're ready to install the node module...

npm install transicc --save

... and start converting colors!

var transicc = require( "transicc" );

transicc( "cmyk", "rgb", [ 100, 0, 0, 0 ], function( err, rgb ){
	if ( err ) throw( err );
	console.log( rgb ); // same as Photoshop, yo!
});

The error parameter in the callback was added in transicc v1.2.0.


Bundled ICC Profiles

Several ICC profiles are bundled with transicc for your convenience. Here's a complete list of the values you can enter into the input or output options of transicc.

CMYK

  • cmyk (shortcut to cmyk-adobe-us-web-coated-swop)
  • cmyk-adobe-coated-fogra27
  • cmyk-adobe-coated-fogra39
  • cmyk-adobe-coated-gracol2006
  • cmyk-adobe-japan-200-newspaper
  • cmyk-adobe-japan-2001-coated
  • cmyk-adobe-japan-2001-uncoated
  • cmyk-adobe-japan-2003-web-coated
  • cmyk-adobe-japan-web-coated
  • cmyk-adobe-uncoated-fogra29
  • cmyk-adobe-us-web-coated-swop
  • cmyk-adobe-us-web-uncoated
  • cmyk-adobe-web-coated-fogra28
  • cmyk-adobe-web-coated-swop-2006-g3
  • cmyk-adobe-web-coated-swop-2006-g5
  • cmyk-eci-iso-coated-v2-300
  • cmyk-eci-iso-coated-v2-eci
  • cmyk-eci-iso-uncoated-yellowish
  • cmyk-eci-pso-coated-300-npscreen-iso12647
  • cmyk-eci-pso-coated-npscreen-iso12647
  • cmyk-eci-pso-lwc-improved
  • cmyk-eci-pso-lwc-standard
  • cmyk-eci-pso-mfc-paper
  • cmyk-eci-pso-snp-paper
  • cmyk-eci-pso-uncoated-iso12647
  • cmyk-eci-pso-uncoated-npscreen-iso12647
  • cmyk-eci-sc-paper

Lab

  • lab (shortcut to lab-apple)

RGB

  • rgb (shortcut to rgb-adobe-1998)
  • rgb-adobe-1998
  • rgb-apple
  • rgb-colormatch
  • rgb-pal-secam
  • rgb-smpte-c
  • rgb-video-hd
  • rgb-video-ntsc
  • rgb-video-pal

sRGB

  • srgb (shortcut to srgb-apple)
  • srgb-apple

XYZ

  • xyz (shortcut to xyz-d65 - the 'standard' luminant associated with daylight)
  • xyz-d50
  • xyz-d55
  • xyz-d65

Note: These profiles are the property of their respective owners, and were copied as-is (simply renamed for easier organization). By using this module, you accept the terms of service agreements associated with their use as provided by Adobe, Apple, ECI, and the ICC.

If there's another ICC profile you'd like bundled with this package, please ensure that the creator of that profile is OK with it being bundled in other software. Once you know that, pull requests away!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.