Photoshop: Histogram shows wrong values

  • 1
  • Problem
  • Updated 2 years ago
  • (Edited)
Histogram shows wrong values if I have two exact same shapes in extact same position with blendmode difference.

I am using this code: 
#target photoshop
app.bringToFront();
app.preferences.rulerUnits = Units.PIXELS;

var histogram = app.activeDocument.histogram;
alert(histogram);
I can see value also in histogram panel.

In my example I have square 100x100px and this is result. 
1) http://sklad.bereza.cz/00-jarda/00_screenshot/2016-03-31_222748.jpg (no transparent color value)
2) http://sklad.bereza.cz/00-jarda/00_screenshot/2016-03-31_222613.jpg (transparent color is white color... last number)

Gray color is number 404...but there in no gray/purple pixel or semi-transparent pixel. 404 is (width + height)*2 of square... so I think... transparent pixels are interpreted like gray/purple.
This could be due to poor surface shape calculation.

I am trying to make a script that determines whether two things are visually identical. Perhaps I use a workaround that will rasterize layers.

Sample file: http://sklad.bereza.cz/00-jarda/histogram-sample-file.psd
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 157 Reply Likes
  • be lucky to find more bugs

Posted 2 years ago

  • 1
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 763 Posts
  • 157 Reply Likes
If I rasterize layers, then it's ok.