Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 111871
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: tony [...] develop-help.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: autolevels_mono doesn't level a 2 level image to B&W
Date: Mon, 8 Feb 2016 19:37:27 +1100
To: bug-Imager [...] rt.cpan.org
From: Tony Cook <tony [...] develop-help.com>
autolevels_mono has two problems here: - the scale value is an integer for 8-bit images, and so if the range between min_lum and max_lum doesn't divide evenly into 255 the "white" level isn't white - there's an off-by-one error calculating min_lum and max_lum, so even if scale is floating point the "black" and "white" source levels are converted to just above black and white. As an optimization, the 8-bit code should use a look-up table.
On Mon Feb 08 03:37:44 2016, tony@develop-help.com wrote: Show quoted text
> autolevels_mono has two problems here: > > - the scale value is an integer for 8-bit images, and so if the range > between min_lum and max_lum doesn't divide evenly into 255 the > "white" level isn't white > > - there's an off-by-one error calculating min_lum and max_lum, so even > if scale is floating point the "black" and "white" source levels are > converted to just above black and white. > > As an optimization, the 8-bit code should use a look-up table.
Fixed in 1.005.