about summary refs log tree commit diff
path: root/analyzer/pnmhistmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'analyzer/pnmhistmap.c')
-rw-r--r--analyzer/pnmhistmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/analyzer/pnmhistmap.c b/analyzer/pnmhistmap.c
index 0b1eeb1f..0e5cf302 100644
--- a/analyzer/pnmhistmap.c
+++ b/analyzer/pnmhistmap.c
@@ -453,7 +453,7 @@ main (int argc, char ** argv) {
     else
         hist_width = range;
 
-    hscale = (float)hist_width / range;
+    hscale = (float)(hist_width-1) / (range-1);
     if (hscale - 1.0 < epsilon && cmdline.verbose)
         pm_message("Horizontal scale factor: %g (maxval = %u)", 
                    hscale, maxval);