To get a histogram using UXP Scripting
To get a histogram of the red channel using ExtendScript Toolkit, I can do the following.
var h = activeDocument.height;
activeDocument.selection.select([[0,0],[0,h],[1,h],[1,0]]);
var data = activeDocument.channels[0].histogram;
However, using the UXP Developer Tools, I get an error when I do the following.
const { app } = require(“photoshop”);
const doc = app.activeDocument;
doc.selection.selectColumn(0);
console.log(doc.channels[0].histogram);
This link has a property to get the histogram, what am I doing wrong?
Translated with www.DeepL.com/Translator (free version)
