ICC::Profile::cvst - An object oriented module for curve sets, used by ICC::Profile objects, or stand-alone.
use ICC::Profile;
# create a new object
$cvst = ICC::Profile::cvst->new(); # empty object
$cvst = ICC::Profile::cvst->new($array_ref); # from an array of curve objects
$cvst = ICC::Profile::cvst->new($file_path); # from a file
# create a new inverse object
$inv = $cvst->inv(); # object is cloned, then inverted
# create a new object containing 'curv' objects
$curv = $cvst->curv($n, [$dir]);
# get/set header hash
$hash_ref = $cvst->header(); # get header hash reference
$hash_ref = $cvst->header($replacement_hash_ref); # set header hash
# get/set array parameters
$array_ref = $cvst->array(); # get input array reference
$array_ref = $cvst->array($replacement_array_ref); # set input array
# get number of channels
$m = $cvst->cin(); # get number of input channels
$n = $cvst->cout(); # get number of output channels
# transform
@list = $cvst->transform(@list, [$hash])
$vector = $cvst->transform($vector, [$hash])
$matrix = $cvst->transform($matrix, [$hash])
$structure = $cvst->transform($structure, [$hash])
Math::Matrix_object = $cvst->transform(Math::Matrix_object, [$hash])
# inverse transform
@list = $cvst->inverse(@list, [$hash])
$vector = $cvst->inverse($vector, [$hash])
$matrix = $cvst->inverse($matrix, [$hash])
$structure = $cvst->inverse($structure, [$hash])
Math::Matrix_object = $cvst->inverse(Math::Matrix_object, [$hash])
# Jacobian matrix
$matrix = $cvst->jacobian($vector, [$hash]);
($matrix, $vector) = $cvst->jacobian($vector, [$hash]);
# parametric Jacobian matrix
$matrix = $cvst->parajac($vector);
# write Agfa Apogee tone curve file
$cvst->apogee(file_path, [options]);
# write CGATS tone curve file
$cvst->cgats(file_path, [options]);
# write device link profile
$cvst->device_link(file_path, [options]);
# write EFI (.vpc/.vcc) tone curve file
$cvst->efi(file_path, [options]);
# write Fuji XMF tone curve file
$cvst->fuji_xmf(file_path, [options]);
# write Harlequin tone curve file
$cvst->harlequin(file_path, [options]);
# write Heidelberg CTS 2.1 tone curve file
$cvst->heidelberg(file_path, [options]);
# write HP Indigo tone curve file set
$cvst->indigo(file_path, [options]);
# write ISO 18620 (TED) tone curve file
$cvst->iso_18620(file_path, [options]);
# write Xitron Navigator tone curve file
$cvst->navigator(file_path, [options]);
# write Photoshop tone curve file
$cvst->photoshop(file_path, [options]);
# write Prinergy (Harmony) tone curve file
$cvst->prinergy(file_path, [options]);
# write Rampage tone curve file set
$cvst->rampage(folder_path, [options]);
# write Xitron Sierra tone curve file
$cvst->sierra(file_path, [options]);
# write Trueflow tone curve file
$cvst->trueflow(file_path, [options]);
# write tab delimited text tone curve file
$cvst->text(file_path, [options]);
# write HTML graph of tone curves
@list = $cvst->graph(folder_path, [options]);
# open files in web browser
open_files(\@list);
# normalize parameters
$cvst = $cvst->normalize([as_needed_for_object_type]);
# update object internals
$cvst->update([as_needed_for_object_type]);
# dump object
$string = $cvst->sdump([$format]);
$cvst->dump([$format]);
The ICC::Profile::cvst
object implements the 'cvst' tag, as defined by ICC Specification ICC.1:2010 (Profile version 4.3.0.0). This tag is normally used as an element in a multiProcessElements ('mpet') tag. It is known as a Curve Set element (see section 10.14.2.2), and contains multiple one-dimensional curves.
The individual curves are implemented using other object types, including ICC::Profile::parf
, ICC::Profile::para
, ICC::Profile::curv
, ICC::Support::bern
, and ICC::Support::spline
. Note that objects beginning with ICC::Profile
are based on tags defined by the ICC specification, whereas those beginning with ICC::Support
are not.
In addition to its use within ICC::Profile
objects, the ICC::Profile::cvst
object may be used stand-alone to implement curve-based transforms. In that context, methods are provided to output the curve set in various pre-press formats, e.g. "apogee". New ICC::Profile::cvst
objects may be created from certain pre-press curve formats, or from an object saved in Storable format.
An ICC::Profile::cvst
object is a blessed array reference. The array contains two elements, the header hash and the curve object array.
# create empty 'cvst' object
my $self = [
{}, # header hash
[] # curve object array
];
The header hash contains metadata, and may be used to attach information to the object.
The curve object array contains references to individual curve objects. These objects must have transform and derivative methods. Normally, ICC::Profile::parf
, ICC::Profile::para
, ICC::Profile::curv
, ICC::Support::bern
, or ICC::Support::spline
objects are used. However, custom curve objects may be used if they are functionally equivalent. Curve objects of different types may be used in a single ICC::Profile::cvst
object, although methods requiring object-specific parameters may fail.
The "transform" and "inverse" methods apply curves to the parameter(s). The parameter(s) may be of various types – array, vector, matrix, structure, or Math::Matrix object. This is meant to simplify programming by allowing a simple method call, however the data is arranged. The output is the same type as the input.
When the data is an array, the method receives individual values for each channel,
@array = $cvst->transform(0.1, 0.2, 0.3);
The number of values must be equal to the number of curve objects (3 in this example).
A vector is an array reference. This is a more efficient way to pass data,
$vector = $cvst->transform([0.1, 0.2, 0.3]);
A matrix is a collection of vectors,
$matrix = $cvst->transform([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]]);
A structure that consists of scalars and vectors,
$structure = $cvst->transform([1, 2, 'buckle my shoe', [0.1, 0.2, 0.3]]);
Only vectors are transformed, scalars are passed through unchanged.
A Math::Matrix object is a blessed matrix,
$obj = $cvst->transform(bless([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]], Math::Matrix));
An ICC::Profile::cvst
object is a container for multiple curve objects. It calls the 'transform' and 'inverse' methods of those objects to process values within the supplied parameter(s). There is no checking of the input or output values, except for output value clipping, when enabled. The domain and range are thus properties of the individual curve objects.
This method creates an ICC::Profile::cvst
object.
With no parameters, the object contains the empty basic structure (see "Object structure").
An object is normally created from an array of curve objects, or a file, as illustrated below.
Usage
$cvst = ICC::Profile::cvst->new(); # empty object
$cvst = ICC::Profile::cvst->new($array_ref); # from an array of curve objects (see note 1)
$cvst = ICC::Profile::cvst->new($file_path); # from a file (see note 2)
Examples
use ICC::Profile;
$cvst = ICC::Profile::cvst->new(); # empty object
$cvst = ICC::Profile::cvst->new([]); # empty array of curves, same as empty object
$c1 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # curve object 1
$c2 = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # curve object 2
$c3 = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # curve object 3
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of curve objects
print Dumper($cvst); # dump the object
Storable::store($cvst, $path = "$ENV{'HOME'}/Desktop/cvst.sto"); # save as Storable file on Desktop
$cvst2 = ICC::Profile::cvst->new($path); # make new curve set object from Storable file
print Dumper($cvst2); # dump the object (see note 3)
$cvst->iso_18620($path2 = '~/Desktop/cvst.xml'); # save as ISO 18620 file on Desktop
$cvst3 = ICC::Profile::cvst->new($path2); # make new curve set object from ISO 18620 file
print Dumper($cvst3); # dump the object (see note 4)
$cvst->text($path3 = '~/Desktop/tab_delim.txt'); # save as tab-delimited text file on Desktop
$cvst4 = ICC::Profile::cvst->new($path3); # make new curve set object from text file (see note 5)
print Dumper($cvst4); # dump the object (see note 6)
The curves may be ICC::Profile::parf
, ICC::Profile::para
, ICC::Profile::curv
, ICC::Support::bern
, or ICC::Support::spline
objects. Custom curve objects are allowed, so long as they have 'transform' and 'derivative' methods.
Supported file types are Storable, ISO 18620, Esko .icpro, Onyx .Lin, and tab-delimited text.
The new curve set object is a clone of the original.
The new curve set object uses ICC::Support::spline
objects, regardless of the object types used in the original.
Each data line contains a curve input value (%-dot), followed by the output values (%-dot) for each ink channel. The curve data values are separated by tabs (tab-delimited). The file may contain non-curve information, e.g. a CGATS format file.
The new curve set object uses ICC::Support::spline
objects, unless the text file contains a line with the degree:
key/value. In that case, the new curve set object will contain ICC::Support::bern
objects, fitted to the curve data. The degree:
value may be an integer between 1 and 8, inclusive. The degree:
value may also be an *
, which indicates to use the largest value supported by the data.
This method creates an inverted ICC::Profile::cvst
object from an existing object.
Usage
$inv = $cvst->inv();
Examples
use ICC::Profile;
$c1 = ICC::Profile::para->new([0, 1.8]); # 'para' object
$c2 = ICC::Profile::curv->new([0, 0.4, 1]); # 'curv' object
$c3 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # 'bern' object
$c4 = ICC::Support::spline->new({'output' => [0, 0.4, 1]}); # 'spline' object
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3, $c4]); # make curve set from array of curve objects (see note 1)
print Dumper($cvst);
$cvst2 = $cvst->inv(); # make new curve set with inverted curve objects (see note 2)
print Dumper($cvst2);
The individual curve objects may have different types.
The ICC::Profile::parf
object doesn't have an 'inv' method, so it cannot be part of an inverted curve set.
This method creates an ICC::Profile::cvst
object containing 'curv' curve objects from an existing object.
Usage
# create a new object containing 'curv' objects
$curv = $cvst->curv($n, [$dir]);
Examples
use ICC::Profile;
$c1 = ICC::Profile::para->new([0, 1.8]); # 'para' curve object
$c2 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # 'bern' curve object
$c3 = ICC::Support::spline->new({'output' => [0, 0.4, 1]}); # 'spline' curve object
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of curve objects (see note 1)
print Dumper($cvst);
$cvst2 = $cvst->curv(11); # make new curve set with 'curv' curve objects (see note 2)
print Dumper($cvst2);
$cvst3 = $cvst->curv(11, 1); # make new curve set with inverted 'curv' curve objects
print Dumper($cvst3);
The individual curve objects may have different types.
ICC::Profile::parf
and ICC::Profile::curv
objects doesn't have a 'curv' method, so they cannot be part of a 'curv' curve set.
This method returns a reference to the header hash (see "Object structure" section). It may also be used to replace the header hash.
Usage
$hash_ref = $cvst->header(); # get header hash reference
$hash_ref = $cvst->header($replacement_hash_ref); # set header hash
Examples
use ICC::Profile;
$cvst = ICC::Profile::cvst->new(); # make 'cvst' object
$hash = $cvst->header(); # get header hash reference (see note 1)
$hash->{'key'} = 'value'; # add key/value to header hash
print Dumper($cvst, $hash);
$cvst->header->{'key2'} = 'value2'; # add key/value in one step
print Dumper($cvst, $hash);
$cvst->header({'new' => 'hash'}); # replace header hash (see note 2)
print Dumper($cvst, $hash);
The hash referenced is within the object, not a copy.
The replacement hash is copied to the object, replacing the original. The original hash reference is now detached from the object, and exists only because it was referenced by the $hash
variable.
This method returns a reference to the curve object array (see "Object structure" section). It may also be used to replace the curve object array.
Usage
$array_ref = $cvst->array(); # get curve object array reference
$array_ref = $cvst->array($replacement_array_ref); # set curve object array
Examples
use ICC::Profile;
$cvst = ICC::Profile::cvst->new(); # make 'cvst' object
$array = $cvst->array(); # get curve object array reference (see note 1)
$array->[0] = ICC::Profile::curv->new([1]); # add a curve to curve object array
print Dumper($cvst, $array);
$cvst->array->[1] = ICC::Profile::curv->new([2]); # add a curve in one step
print Dumper($cvst, $array);
$cvst->array([ICC::Profile::curv->new([3])]); # replace curve object array (see note 2)
print Dumper($cvst, $array);
The array referenced is within the object, not a copy.
The replacement array is copied to the object, replacing the original. The original array reference is now detached from the object, and exists only because it was referenced by the $array
variable.
This method returns the number of input channels (curve objects).
Usage
$m = $cvst->cin(); # get number of input channels
Examples
use ICC::Profile;
$curv = ICC::Profile::curv->new([1]); # make a single 'curv' object
$cvst = ICC::Profile::cvst->new([$curv->copy(3)]); # make a curve set with 3 'curv' objects
print Dumper($cvst);
printf "%d inputs \n", $cvst->cin(); # print the number of input channels (see note 1)
For a curve set object, the number of input and output channels are always the same.
This method returns the number of output channels (curve objects).
Usage
$m = $cvst->cout(); # get number of output channels
Examples
use ICC::Profile;
$curv = ICC::Profile::curv->new([1]); # make a single 'curv' object
$cvst = ICC::Profile::cvst->new([$curv->copy(3)]); # make a curve set with 3 'curv' objects
print Dumper($cvst);
printf "%d inputs \n", $cvst->cout(); # print the number of output channels (see note 1)
For a curve set object, the number of input and output channels are always the same.
This method transforms data of various types, including lists, vectors, matrices, and certain structures. The output type is identical to the input type, which is automatically detected by the method. The processing of each element is done by the corresponding curve object's transform method.
Usage
@list = $cvst->transform(@list, [$hash])
$vector = $cvst->transform($vector, [$hash])
$matrix = $cvst->transform($matrix, [$hash])
$structure = $cvst->transform($structure, [$hash])
Math::Matrix_object = $cvst->transform(Math::Matrix_object, [$hash])
Examples
use ICC::Profile;
$c1 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # curve object 1
$c2 = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # curve object 2
$c3 = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # curve object 3
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of three curve objects
@list = $cvst->transform(0.1, 0.2, 0.3); # list transform, number of elements == number of curves (see note 1)
print "@list\n";
@list = $cvst->transform(0.1, 0.2, 0.3, 0.4); # list transform, number of elements > number of curves (see note 1)
print "@list\n";
@list = $cvst->transform(0.1, 0.2); # list transform, number of elements < number of curves, is an error! (see note 1)
print "@list\n";
$vector = $cvst->transform([0.1, 0.2, 0.3]); # vector transform (see note 1)
print Dumper($vector);
$matrix = $cvst->transform([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]]); # matrix transform (see note 2)
print Dumper($matrix);
$structure = $cvst->transform([1, 2, 'buckle my shoe', [0.1, 0.2, 0.3]]); # structure transform (see note 3)
print Dumper($structure);
$obj = $cvst->transform(bless([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]], 'Math::Matrix')); # Math::Matrix object (see note 2)
$obj->dump(); # (see note 4)
$vector = $cvst->transform([0.5, 2, -2], {'clip' => 1}); # vector transform with clipping (see note 5)
print Dumper($vector);
The number of data elements should equal the number of curves. Extra data elements are ignored. Missing data elements cause an error.
The matrix is row-major, and the number of data elements in each row should equal the number of curves.
The structure must be composed of scalars and vectors. Vectors are transformed, but scalars are passed through unmodified.
A Math::Matrix object has the same structure as a regular matrix, plus a large assortment of methods, some of which are supplied by the ICC::Shared module.
Output clipping is enabled using the 'clip' hash key. Output values are limited to between 0 and 1.
This method transforms data of various types, including lists, vectors, matrices, and certain structures. The output type is identical to the input type, which is automatically detected by the method. The processing of each element is done by the corresponding curve object's inverse method.
Usage
@list = $cvst->inverse(@list, [$hash])
$vector = $cvst->inverse($vector, [$hash])
$matrix = $cvst->inverse($matrix, [$hash])
$structure = $cvst->inverse($structure, [$hash])
Math::Matrix_object = $cvst->inverse(Math::Matrix_object, [$hash])
Examples
use ICC::Profile;
$c1 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # curve object 1
$c2 = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # curve object 2
$c3 = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # curve object 3
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of three curve objects
@list = $cvst->inverse(0.1, 0.2, 0.3); # list inverse, number of elements == number of curves (see note 1)
print "@list\n";
@list = $cvst->inverse(0.1, 0.2, 0.3, 0.4); # list inverse, number of elements > number of curves (see note 1)
print "@list\n";
@list = $cvst->inverse(0.1, 0.2); # list inverse, number of elements < number of curves, is an error! (see note 1)
print "@list\n";
$vector = $cvst->inverse([0.1, 0.2, 0.3]); # vector inverse (see note 1)
print Dumper($vector);
$matrix = $cvst->inverse([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]]); # matrix inverse (see note 2)
print Dumper($matrix);
$structure = $cvst->inverse([1, 2, 'buckle my shoe', [0.1, 0.2, 0.3]]); # structure inverse (see note 3)
print Dumper($structure);
$obj = $cvst->inverse(bless([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]], 'Math::Matrix')); # Math::Matrix object (see note 2)
$obj->dump(); # (see note 4)
$vector = $cvst->inverse([0.5, 2, -2], {'clip' => 1}); # vector inverse with clipping (see note 5)
print Dumper($vector);
The number of data elements should equal the number of curves. Extra data elements are ignored. Missing data elements cause an error.
The matrix is row-major, and the number of data elements in each row should equal the number of curves.
The structure must be composed of scalars and vectors. Vectors are transformed, but scalars are passed through unmodified.
A Math::Matrix object has the same structure as a regular matrix, plus a large assortment of methods, some of which are supplied by the ICC::Shared module.
If the 'clip' hash key is true, output values are limited to between 0 and 1.
This method returns the Jacobian matrix of the vector transform, and optionally, the transform output. The diagonal matrix elements are computed using the curve object's derivative method.
Usage
$matrix = $cvst->jacobian($vector, [$hash]);
($matrix, $vector) = $cvst->jacobian($vector, [$hash]);
Examples
use ICC::Profile;
$c1 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # curve object 1
$c2 = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # curve object 2
$c3 = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # curve object 3
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of three curve objects
$jac = $cvst->jacobian([0.1, 0.2, 0.3]); # compute the Jacobian matrix (see note 1)
$jac->dump(); # (see note 2)
($jac, $vector) = $cvst->jacobian([0.1, 0.2, 0.3]); # also compute the transform vector (see note 3)
print Dumper($vector);
$jac = $cvst->jacobian([0.1, 0.2, 0.3], {'diag' => 1}); # return the matrix diagonal values as a vector (see note 4)
print Dumper($jac);
The returned value is a Math::Matrix object (unless the 'diag' hash key is true).
The matrix is square and diagonal (the non-diagonal elements are 0).
This notation returns both the Jacobian matrix and the transformed vector, which are often used together.
If the 'diag' hash key is true, the diagonal matrix elements are returned as a vector, rather than a matrix.
This method returns the parametric Jacobian matrix, which is computed using the curve object's parametric method.
Usage
$matrix = $cvst->parajac($vector);
Examples
use ICC::Profile;
$c1 = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # curve object 1
$c2 = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # curve object 2
$c3 = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # curve object 3
$cvst = ICC::Profile::cvst->new([$c1, $c2, $c3]); # make curve set from array of three curve objects
$jac = $cvst->parajac([0.1, 0.2, 0.3]); # compute parametric Jacobian matrix (see note 1)
$jac->dump; # (see note 2)
$cvst->header->{'slice'} = [1]; # set the 'slice' to a vector (see note 3)
$cvst->parajac([0.1, 0.2, 0.3])->dump;
$cvst->header->{'slice'} = [[0], [1], [2]]; # set the 'slice' to a matrix (see note 4)
$cvst->parajac([0.1, 0.2, 0.3])->dump;
$cvst->header->{'slice'} = [[0], [], [0, 1, 2]]; # set the 'slice' to an irregular matrix (see note 5)
$cvst->parajac([0.1, 0.2, 0.3])->dump;
$cvst->header->{'slice'} = [7]; # slice contains an illegal index (see note 6)
$cvst->parajac([0.1, 0.2, 0.3])->dump;
The returned value is a Math::Matrix object.
The matrix is m x n, where m is the number of curves, and n is the total number of curve parameters.
If the header 'slice' value is a vector, it is used to select the parameters used from all curves.
If the header 'slice' value is a matrix, it is used to select the parameters used from each curve individually.
The header 'slice' matrix may be irregular, but must contain a row for each curve.
The header 'slice' vector or matrix must contain legal indices for each curve's parameters.
A curve set may be output in a various formats. The domain and range of the curves is assumed to be 0 to 1. The output values are computed using each curve's _transform method. These values are converted to %-values by the output method, if needed.
This format is used by Agfa's Apogee DFE. It is an XML format.
Usage
$cvst->apogee(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->apogee('~/Desktop/apogee.xml'); # output curves in Apogee curve format
$cvst->apogee('~/Desktop/apogee2.xml', 1); # inverse curves (see note 2)
$cvst->apogee('~/Desktop/apogee3.xml', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->apogee('~/Desktop/apogee4.xml', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir' and 'steps'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
This is a text format loosely based on the ANSI/CGATS.17 exchange format for measurement data. The SAMPLE_NAME field contains the input %-dot value, and the device fields (e.g. CMYK_C, CMYK_M, CMYK_Y, CMYK_K) contain the output %-dot values.
Usage
$cvst->cgats(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->cgats('~/Desktop/cgats.txt'); # output curves in CGATS.17 format
$cvst->cgats('~/Desktop/cgats2.txt', 1); # inverse curves (see note 2)
$cvst->cgats('~/Desktop/cgats3.txt', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->cgats('~/Desktop/cgats4.txt', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set with spot color
$cvst->cgats('~/Desktop/cgats5.txt'); # output curves in CGATS.17 format (see note 6)
Curves must be CMYK + spots, in that order.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir' and 'steps'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
Spot colors are supported.
This format is an ICC device link profile. The number of input and output channels are equal to the number of curves.
Usage
$cvst->device_link(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->device_link('~/Desktop/device_link.icc'); # output curves as device link profile
$cvst->device_link('~/Desktop/device_link2.icc', 1); # inverse curves (see note 2)
$cvst->device_link('~/Desktop/device_link3.icc', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->device_link('~/Desktop/device_link4.icc', {'desc' => 'pod example'}); # profile description (see notes 3 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set with spot color
$cvst->device_link('~/Desktop/device_link5.icc'); # output curves as device link profile (see note 6)
GRAY, RGB, CMYK, and nCLR profiles are supported.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir' and 'desc'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'desc' key overrides the built-in description.
Spot colors are supported with nCLR profiles.
This format is used by EFI XF as .vpc/.vcc curves. Up to eight channels are supported.
Usage
$cvst->efi(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->efi('~/Desktop/efi.vpc'); # output curves as efi .vpc file (see note 2)
$cvst->efi('~/Desktop/efi.vcc'); # output curves as efi .vcc file (see note 2)
$cvst->efi('~/Desktop/efi2.vcc', 1); # inverse curves (see note 3)
$cvst->efi('~/Desktop/efi3.vcc', {'dir' => 1}); # same (see notes 4 and 5)
$cvst->efi('~/Desktop/efi4.vcc', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 4 and 6)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set with spot color
$cvst->efi('~/Desktop/efi5.vcc'); # output curves as efi .vcc file (see note 7)
RGB, CMYK, and spot colors are supported, up to 8 channels.
EFI XF .vpc and .vcc curves are identical, except for the file suffix, which determines where they appear in the EFI client. Use the .vpc suffix for application prior to color management, and the .vcc suffix for application after color management.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir' and 'steps'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
Spot colors are supported.
This format is used by the Fuji XMF DFE, which was developed by FFEI.
Usage
$cvst->fuji_xmf(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->fuji_xmf('~/Desktop/fuji_xmf.csv'); # output curves as fuji XMF file
$cvst->fuji_xmf('~/Desktop/fuji_xmf2.csv', 1); # inverse curves (see note 2)
$cvst->fuji_xmf('~/Desktop/fuji_xmf3.csv', {'dir' => 1}); # same (see notes 3 and 4)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The Harlequin RIP is a widely used software for driving print devices. While there is support for user generated tone curves, the curve data must be entered manually into a form, with fixed input %-dot values. This method generates a text file containing these values. The Xitron Navigator RIP, which is Harlequin-based, allows for "push calibration", which eliminates the manual entry. This capability may exist in other Harlequin-based RIPs. See "navigator".
Usage
$cvst->harlequin(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->harlequin('~/Desktop/harlequin.txt'); # output curves as harlequin file.
$cvst->harlequin('~/Desktop/harlequin2.txt', 1); # inverse curves (see note 2)
$cvst->harlequin('~/Desktop/harlequin3.txt', {'dir' => 1}); # same (see notes 3 and 4)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format is used by the Heidelberg Prinect DFE. The curve format is based on the CGATS.17 text format, as used by CTS 2.1.
Usage
$cvst->heidelberg(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->heidelberg('~/Desktop/heidelberg.txt'); # output curves in Heidelberg Prinect format
$cvst->heidelberg('~/Desktop/heidelberg2.txt', 1); # inverse curves (see note 2)
$cvst->heidelberg('~/Desktop/heidelberg3.txt', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->heidelberg('~/Desktop/heidelberg4.txt', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
$cvst->heidelberg('~/Desktop/heidelberg5.txt', {'type' => 'calibration'}); # calibration curve type (see notes 3 and 6)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', 'steps', and 'type'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
The 'type' key sets the curve type - 'measured' (default) or 'calibration'.
This format is used by the controller of the HP Indigo press.
Usage
$cvst->indigo(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->indigo('~/Desktop/indigo.txt'); # output curves as indigo file.
$cvst->indigo('~/Desktop/indigo2.txt', 1); # inverse curves (see note 2)
$cvst->indigo('~/Desktop/indigo3.txt', {'dir' => 1}); # same (see notes 3 and 4)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format is defined by ISO 18620, originally created by Esko/Artwork Systems, and known as the TED format. It is an XML format.
Usage
$cvst->iso_18620(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->iso_18620('~/Desktop/iso_18620.ted'); # output curves as an ISO 18620 file.
$cvst->iso_18620('~/Desktop/iso_18620_2.ted', 1); # inverse curves (see note 2)
$cvst->iso_18620('~/Desktop/iso_18620_3.ted', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->iso_18620('~/Desktop/iso_18620_4.ted', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set from array of curve objects (see note 1)
$cvst->iso_18620('~/Desktop/iso_18620_5.ted', {'inks' => [qw(Cyan Magenta Yellow Black Red)]}); # ink names (see note 6)
$c = ICC::Support::bern->new({'output' => [0.025, 0.4, 1]}); # cyan curve object (2.5% min dot)
$m = ICC::Support::bern->new({'output' => [0.025, 0.5, 1]}); # magenta curve object (2.5% min dot)
$y = ICC::Support::bern->new({'output' => [0.025, 0.6, 1]}); # yellow curve object (2.5% min dot)
$k = ICC::Support::bern->new({'output' => [0.025, 0.55, 1]}); # black curve object (2.5% min dot)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->iso_18620('~/Desktop/iso_18620_6.ted', {'steps' => [0, 0, 50, 100], 'origin' => 1}); # flexo bump in highlights (see note 7)
Curves must be Grayscale, CMYK, CMYK + spot(s), or n-color.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', 'steps', 'inks', 'origin', 'Creator', 'OperatorName', 'PressName', 'MediaName', 'TransferCurveSetID', and 'Side'. The 'Creator', 'OperatorName', 'PressName', 'MediaName', 'TransferCurveSetID', and 'Side' keys allow you to set these properties in the curve file.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
The 'inks' key sets the ink colors. If this
The 'origin' key is a flag that, when true, forces the output value of the first curve point to be 0 for all inks. This is used to implement a "flexo bump", to compensate for imperfect highlight dot retention in the plates.
The Xitron Navigator RIP allows for "push calibration". This is accomplished with a PostScript file, as described in Harlequin Technical Note Hqn081. This functionality is available in Harlequin Server RIP v9.0 onwards.
Usage
$cvst->navigator(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->navigator('~/Desktop/navigator.ps'); # output curves as Harlequin PostScript file.
$cvst->navigator('~/Desktop/navigator2.ps', 1); # inverse curves (see note 2)
$cvst->navigator('~/Desktop/navigator3.ps', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->navigator('~/Desktop/navigator4.ps', {'name' => 'uncoated_175L'}); # set the name (see notes 3 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set from array of curve objects (see note 1)
$cvst->navigator('~/Desktop/navigator5.ps', {'inks' => [qw(Cyan Magenta Yellow Black Red)]}); # set ink colors (see notes 3, 6)
$cvst = ICC::Profile::cvst->new([$k]); # make curve set from array of curve objects (see note 1)
$cvst->navigator('~/Desktop/navigator6.ps', {'colorspace' => 'DeviceGray'}); # set colorspace (see notes 3, 7)
Curves must be Grayscale, CMYK, or CMYK + spot(s).
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', 'inks', 'name', 'colorspace'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'name' key sets the internal name of the calibration set.
The 'inks' key sets the ink color names, overrides the default values.
The 'colorspace' key sets the internal colorspace, 'DeviceGray' or 'DeviceCMYK'. If you need another colorspace, e.g. 'Hex', contact the author.
Onyx RIPs don't support tone reproduction curves, but they do use a linearization file for calibration. This method outputs curves in that format (.Lin).
Usage
$cvst->onyx(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->onyx('~/Desktop/Linearization.Lin'); # output curves as Onyx .Lin format
$cvst->onyx('~/Desktop/Linearization.Lin', 1); # inverse curves (see note 2)
$cvst->onyx('~/Desktop/Linearization.Lin', {'dir' => 1}); # same (see notes 3 and 4)
Curves may have any number of channels.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format is used by Photoshop to load/save curves.
Usage
$cvst->photoshop(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->photoshop('~/Desktop/photoshop.acv'); # output curves in Photoshop format
$cvst->photoshop('~/Desktop/photoshop2.acv', 1); # inverse curves (see note 2)
$cvst->photoshop('~/Desktop/photoshop3.acv', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->photoshop('~/Desktop/photoshop4.acv', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
Curves may be Grayscale, RGB, CMYK, or n-color.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', and 'steps'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps. Curves must have between 2 and 16 steps.
This format is used by Kodak Prinergy systems. The format originated with the Creo Harmony software. Kodak purchased Creo in 2005. Use the Kodak ColorFlow software to load these curves.
Usage
$cvst->prinergy(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->prinergy('~/Desktop/prinergy.hmy'); # output curves as Prinergy .hmy file (see note 2)
$cvst->prinergy('~/Desktop/prinergy2.hmy', 1); # inverse curves (see note 3)
$cvst->prinergy('~/Desktop/prinergy3.hmy', {'dir' => 1}); # same (see notes 4 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set with spot color
$cvst->prinergy('~/Desktop/prinergy5.hmy'); # output curves as prinergy .hmy file (see note 6)
CMYK and spot colors are supported, up to 16 channels.
The format is known as a Harmony file, after the Creo software where it originated.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', 'Comments', 'CurveSet', 'DefaultFrequency', 'DefaultMedium', 'DefaultResolution', 'DefaultSpotFunction', 'Enabled', 'FirstName', 'FreqFrom', 'FreqTo', 'ID', 'Medium', 'Resolution', 'ScreeningType', 'SpotFunction', 'SpotFunctionMode'. All of the hash keys, other than 'dir', are used to set properties within the Harmony curve set.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
Spot colors are supported.
This format was used by Rampage, a once common prepress DFE, beloved by its users. Fuji promoted Rampage for many years, and purchased the company in 2013. Many Rampage users migrated to Fuji XMF workflow after Fuji ended development of new Rampage versions.
Usage
$cvst->rampage(folder_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->rampage('~/Desktop/rampage'); # output curves as Rampage file set (see note 2)
$cvst->rampage('~/Desktop/rampage2', 1); # inverse curves (see note 3)
$cvst->rampage('~/Desktop/rampage3', {'dir' => 1}); # same (see notes 4 and 5)
Curves must be CMYK, in that order.
Curves are output in a folder. For each color (CMYK), there is and actual (ACT) and desired (DESIRED) curve.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format is used by the Xitron Sierra DFE, which was developed by FFEI.
Usage
$cvst->sierra(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->sierra('~/Desktop/sierra.csv'); # output curves as Sierra file
$cvst->sierra('~/Desktop/sierra2.csv', 1); # inverse curves (see note 2)
$cvst->sierra('~/Desktop/sierra3.csv', {'dir' => 1}); # same (see notes 3 and 4)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format was used by the Screen Trueflow workflow, which has been superseded by the Equios workflow.
Usage
$cvst->trueflow(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->trueflow('~/Desktop/trueflow.dgt'); # output curves as Sierra file
$cvst->trueflow('~/Desktop/trueflow2.dgt', 1); # inverse curves (see note 2)
$cvst->trueflow('~/Desktop/trueflow3.dgt', {'dir' => 1}); # same (see notes 3 and 4)
Curves must be CMYK, in that order. Spot colors are not yet supported. Contact the author if you need that capability.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported key 'dir'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
This format is a tab-delimited text file, with the first column containing the input %-dot, and the remaining columns containing the output %-dot for each channel.
Usage
$cvst->text(file_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->text('~/Desktop/text.txt'); # output curves as a text file
$cvst->text('~/Desktop/text_2.txt', 1); # inverse curves (see note 2)
$cvst->text('~/Desktop/text_3.txt', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->text('~/Desktop/text_4.txt', {'steps' => [0, 50, 100]}); # curve steps 0%, 50%, 100% (see notes 3 and 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set from array of curve objects (see note 1)
$cvst->text('~/Desktop/text_5.txt'); # output curves as a text file (with spot color)
Curves may be Grayscale, RGB, CMYK, CMYK + spot, or n-color.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', and 'steps'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'steps' key overrides the built-in curve steps.
This method makes graphs of the curve set using the RGraph Javascript library. These graphs are SVG (vector) images that may be zoomed to any enlargement. The graphs are HTML5, and are opened in the default web browser.
Usage
@list = $cvst->graph(folder_path, [options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$spot = ICC::Support::bern->new({'output' => [0, 0.45, 1]}); # spot color curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects (see note 1)
$cvst->graph('~/Desktop/my_graphs'); # write graphs to folder, and open in default web browser
$cvst->graph('~/Desktop/my_graphs', 1); # inverse graphs (see note 2)
$cvst->graph('~/Desktop/my_graphs', {'dir' => 1}); # same (see notes 3 and 4)
$cvst->graph('~/Desktop/my_graphs', {'composite' => 1}); # composite graph (see note 5)
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k, $spot]); # make curve set from array of curve objects (see note 1)
$cvst->graph('~/Desktop/my_graphs'); # CMYK + spot (see note 6)
$cvst->graph('~/Desktop/my_graphs', {'colors' => [qw(cyan magenta yellow black red)]}); # ink colors (see note 7)
$cvst->graph('~/Desktop/my_graphs', {'titles' => [qw(~cyan ~magenta ~yellow ~black ~red)]}); # graph titles (see note 8)
@list = $cvst->graph('~/Desktop/my_graphs', {'open' => 0}); # create but don't open the graphs (see note 10)
# ..... add some other graphs to the list .....
ICC::Profile::cvst::open_files(\@list); # now open the graphs in the default web browser
Curves may be Grayscale, RGB, CMYK, CMYK + spot, or n-color.
Scalar option indicates transform direction – 0 for normal, 1 for inverse.
Hash reference option with supported keys 'dir', 'lib', 'composite', 'titles', 'colors', 'files', and 'open'.
The 'dir' key indicates transform direction – 0 for normal, 1 for inverse.
The 'composite' key is a flag that, when true, causes a composite graph (all curves in a single graph) to be displayed.
The spot color is named ink_5, and the graph color is gray.
The 'colors' key sets the graph plot colors. The value is an array, with an entry for each curve. Colors may be names (as supported by RGraph), or array references containing sRGB device values. Default colors are based on the number of curves in the object.
The 'titles' key sets the graph titles only.
The 'files' key sets the names of the HTML graph files. This is used to distinguish different graphs of the same color.
The 'open' key is a flag that, when false, prevents the graphs from being opened.
This function opens a list of files in the default web browser. It is not exported by the module, so it must be called using the full namespace, i.e. ICC::Profile::cvst::open_files(\@list).
Usage
open_files(\@list);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects
@list = $cvst->graph('~/Desktop/my_graphs', {'open' => 0}); # create but don't open the graphs (see note 1)
# ..... add some other graphs to the list .....
ICC::Profile::cvst::open_files(\@list); # now open the graphs in the default web browser
The 'open' key is a flag that, when false, prevents the graphs from being opened immediately. The file list, @list, contains the file paths of the graphs. At the appropriate time, the graphs are displayed by calling the open_files function.
This method calls the normalize method of each curve object. If the curve objects don't have a normalize method, a warning is given. Refer to the documentation for the curve objects.
Usage
$cvst = $cvst->normalize([options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects
$cvst->normalize({'output' => [0, 100]}); # set the output range to 0 - 100 (see note 1)
$cvst->dump();
The normalize method for each curve object is called with the same parameter. See the documentation for the bern curve object.
This method calls the update method of each curve object. If the curve objects don't have a update method, a warning is given. Refer to the documentation for the curve objects.
Usage
$cvst->update([options]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects
# optimize the curves, changing the 'output' values
$cvst->update(); # update internal object values (see note 1)
$cvst->dump();
The update method for each curve object is called. See the documentation for the bern curve object.
This method returns a string showing the structure of the 'cvst' object.
Usage
$string = $cvst->sdump([$format]);
$cvst->dump([$format]);
Examples
use ICC::Profile;
$c = ICC::Support::bern->new({'output' => [0, 0.4, 1]}); # cyan curve object
$m = ICC::Support::bern->new({'output' => [0, 0.5, 1]}); # magenta curve object
$y = ICC::Support::bern->new({'output' => [0, 0.6, 1]}); # yellow curve object
$k = ICC::Support::bern->new({'output' => [0, 0.55, 1]}); # black curve object
$cvst = ICC::Profile::cvst->new([$c, $m, $y, $k]); # make curve set from array of curve objects
$string = $cvst->sdump(); # dump to string
print "$string\n"; # print the string
$cvst->dump(); # dump to STDOUT
ICC Specification ICC.1:2010 (Profile version 4.3.0.0) – Defines ICC profile format.
ISO 18620 – Defines a flexible XML curve format.
ISO 28178 – Defines the CGATS.17 ASCII format.
Programs in this distribution, authored by William B. Birkett, are licensed under the GNU General Public License, v3.
See https://www.gnu.org/licenses/gpl-3.0.html for license details.
William B. Birkett, <wbirkett@doplganger.com>
Copyright © 2004-2024 by William B. Birkett
Hey! The above document had some coding errors, which are explained below:
'=item' outside of any '=over'