about summary refs log tree commit diff
path: root/converter/other/ppmtopgm.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/other/ppmtopgm.c')
-rw-r--r--converter/other/ppmtopgm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/converter/other/ppmtopgm.c b/converter/other/ppmtopgm.c
index 86e7ae6a..e20c5660 100644
--- a/converter/other/ppmtopgm.c
+++ b/converter/other/ppmtopgm.c
@@ -36,9 +36,9 @@ convertRaster(FILE *       const ifP,
                 outputRow[col] = (gray) ppm_fastlumin(inputRow[col]);
         } else {
             /* Can't use fast approximation, so fall back on floats. */
-            int col;
+            unsigned int col;
             for (col = 0; col < cols; ++col) 
-                outputRow[col] = (gray) (PPM_LUMIN(inputRow[col]) + 0.5);
+                outputRow[col] = ppm_luminosity(inputRow[col]);
         }
         pgm_writepgmrow(ofP, outputRow, cols, maxval, 0);
     }