Skip to main content
Participant
March 2, 2015
Question

use extracted histogram data

  • March 2, 2015
  • 1 reply
  • 554 views

I was wondering if it was possible to use the histogram data as an input for a formula, then use the output values from the formula as anchor points in an adjustment curve?

I am using this script to export data to a .csv file, but I'm trying to get away from using a spreadsheet to do the work.... it takes to long to go back and forth to get the values and place the anchor points.

// Get the histogram data

// ----------------------

var luminosity = activeDocument.histogram;

var red = activeDocument.channels["Red"].histogram;

var green = activeDocument.channels["Green"].histogram;

var blue = activeDocument.channels["Blue"].histogram;

var datFile = new File("~/Desktop/Histogram.csv");

datFile.open("e");

datFile.writeln("Level,Luminosity,Red,Green,Blue\r");

for ( i = 0; i <= 255; i++ ) {

   datFile.writeln(i + "," + luminosity + "," + red + "," + green + "," + blue + "\r");

}

datFile.close();

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
March 3, 2015