Disecting Adobe curve (.acv) files.

Recently, I have been trying to create my own Adobe curve (.acv) files, but I found little information on the web through searching. I wanted to share what I found, since it could be helpful to others.

Photoshop curves dialog box

In this example, I have created a curve file with one assigned point for each channel in an RGB file. This essentially creates 3 points per channel. Each point has 2 values; an input and an output.

From what I found in my searching, the phrase was just repeated, “the file is just a list of points.” We’ll, that turned out to be true, but it wasn’t immediately apparent to me how the points were listed in the .acv file.

It was obiously not a text file, so lets do a hex dump of the file.

tony@hesiod ~$ hexdump demo_curve.acv
0000000 00 04 00 05 00 03 00 00 00 00 00 80 00 40 00 ff
0000010 00 ff 00 03 00 00 00 00 00 c0 00 80 00 ff 00 ff
0000020 00 03 00 00 00 00 00 80 00 c0 00 ff 00 ff 00 03
0000030 00 00 00 00 00 40 00 80 00 ff 00 ff 00 02 00 00
0000040 00 00 00 ff 00 ff
0000046

The breakdown of the hex values is as follows:

00-03: The file header.
04-05: The number of points for the RGB curve
06-07: The input value for the minimum for the RGB curve
08-09: The output value for the minimum for the RGB curve
0A-0B: The input value for the defined point
0C-0D: The output value for the defined point
0E-0F: The input value for the maximum for the RGB curve
10-11: The output value for the maximum for the RGB curve

The sequence continues for all remaining channels, and the last sequence is ignored for 3-channel files. For RGB files, it is RGB, Red, Green, Blue, then ignored.

There are a few rules for the acv files.

  • All ‘input’ points must be separated by a value of at least 4
  • There is a maximum of 13 points, including the min/max

For another example, this is a curve file that contains no curves

tony@hesiod ~$ hexdump no_curve.acv
0000000 00 04 00 05 00 02 00 00 00 00 00 ff 00 ff 00 02
0000010 00 00 00 00 00 ff 00 ff 00 02 00 00 00 00 00 ff
0000020 00 ff 00 02 00 00 00 00 00 ff 00 ff 00 02 00 00
0000030 00 00 00 ff 00 ff
0000036

From that you can see that all the channels have a curve with two points–the min and the max, and there are 5 channels. In the CMYK colorspace, it would be CMYK together, cyan, magenta, yellow, black.

Hope this was helpful to at least one person!

Posted in Imaging | Comments Off