Photoshop histogram mean value != IM mean value

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
forumware

Photoshop histogram mean value != IM mean value

Post by forumware »

Hi, on another thread, FMW has helped with a script that converts an image to grayscale and appends the mean value of gray to the filename, but when i compare this mean value with one in photoshop's histogram tab, they do not match.

I've been using this page as reference: http://kb2.adobe.com/cps/315/315207.html that mentions how to convert levels to % and backwards. I'm plugging the number from photoshop but nothing is matching. Any input please?

Level = 256 - [(256)(P)/100]
IM %: 11.2288
Calculated level: 227.254272

Percentage = .390625(256 - L)
photoshop mean: 28.64
Calculated %: 88.8125
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Photoshop histogram mean value != IM mean value

Post by fmw42 »

That paper seems to be about INK densities and not graylevels.

To convert from 8-bit graylevel (range 0 to 255), say call it V (for any R,G,B channel or grayscale) to percent, you simply do:

100*V/255=value in percent
Post Reply