[Digikam-devel] [Bug 170170] High quality 8 to 16-bit conversion (histogram repair)

Dik Takken d.h.j.takken at xs4all.nl
Wed Feb 3 14:27:53 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=170170





--- Comment #8 from Dik Takken <d h j takken xs4all nl>  2010-02-03 15:27:51 ---
I just took a quick peek at the patch, and I realized that this patch will make
the image slightly brighter. Statistically, it will add 128 to the value of
every pixel. I don't know if the brightening will be visible, but here is an
improved algorithm:

function RepairHistogram()
{
  for every pixel do
  {
    for every channel do
    {
      // Add noise:
      Pixel[channel].value += ( Random() % 256 ) - 128

      // Fix clipping:
      Pixel[channel].value = MAX(Pixel[channel].value, 0)
      Pixel[channel].value = MIN(Pixel[channel].value, 65535)
    }
  }
}

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list