Re: color deficit simulation filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2007/11/10, Sven Neumann <sven@xxxxxxxx>:

On Sat, 2007-11-10 at 19:25 +0100, Giacomo Mazzocato wrote:

> I've tried to reimplement it in another language

I very much hope for you that you are respecting the license that this
code has been published under. Your code is GPL, right?

Now it's for private use and I if I release it i will be GPL.
But can you put a license on an algorithm?

> and in the function
> cdisplay_colorblind_convert with certain colors (for instance #000000) I get a
> warning of division by zero in the section that corresponds to this in the
> original code:
>  switch (colorblind->deficiency)
>           {
>           case COLORBLIND_DEFICIENCY_DEUTERANOPIA:
>               tmp = blue / red;
>               ^^^^^^^^^^

Division by zero is handled correctly here. The result will be NaN.

I'll do further checking on how Nan is handled as soon as I can lay a hand on a C compiler. In particular I wonder if Nan can be less than a normal numberic value because the lines that follow in that function depend on that.

> The most important problem is however that when I try to convert white
> (#ffffff) with the filter,I get #dadada for all 3 deficit simulations.
>
> #dadada is a shade of grey, but if I apply in gimp the filter to an area which
> contains white regions, white remains white.

If you have other display filters active, then the colors may be passed
through them befor they are displayed. Otherwise, no, there is no
further post-processing being done.

No other filter is active but I still see white if I convert a white region. That's strange. Can you confirm that #ffffff is converted to #dadada ?

Perhaps you should just link with libcolorblind (see
http://colorblind.alioth.debian.org/) instead of reimplementing the
algorithm...

I'll check that library, thanks for the link
Bye,
Giacomo
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux