From 6d06b8e0c26536edaedf04ae56849667b85c1325 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 20 Jan 2019 19:22:55 +0000 Subject: Fix handling of floating point imprecision in unnormalizing samples git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3513 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pnmhisteq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editor/pnmhisteq.c') diff --git a/editor/pnmhisteq.c b/editor/pnmhisteq.c index 76fd6d2a..a339f73f 100644 --- a/editor/pnmhisteq.c +++ b/editor/pnmhisteq.c @@ -426,7 +426,7 @@ remapRgbValue(xel const thisXel, struct hsv const hsv = ppm_hsv_from_color(thisXel, maxval); xelval const oldValue = - MIN(maxval, ROUNDU(hsv.v * maxval)); + MIN(maxval, pnm_unnormalize(hsv.v, maxval)); xelval const newValue = lumamap[oldValue]; -- cgit 1.4.1