Hello everyone,<br><br>I think there may have a bug in the &#39;io_png.c&#39; file provided on IPOL.<br><br>We wanted with Édouard to use the function &#39;read_png_u8_gray&#39; but we found out that there is a problem when computing the intensity of a color image. Indeed, the code on lines 330--333 :<br>
<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><div style="margin-left: 40px;"><span style="font-family: arial,helvetica,sans-serif;">while (ptr_gray &lt; ptr_end)</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">            *ptr_gray++ = (unsigned char) (6969 * *ptr_r++</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">                                           + 23434 * *ptr_g++</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">                                           + 2365 * *ptr_b++) / 32768;</span><br style="font-family: arial,helvetica,sans-serif;"></div></blockquote><br>should be<br>
<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><div style="margin-left: 40px;">while (ptr_gray &lt; ptr_end)<br>            *ptr_gray++ = (unsigned char) ((6969.f * *ptr_r++<br>
                                           + 23434.f * *ptr_g++<br>                                           + 2365.f * *ptr_b++) / 32768.f);<br></div></blockquote><br>Best regards,<br clear="all"><br>-- <br>Julien Rabin<br>
Post-Doctorant au <a href="http://www.cmla.ens-cachan.fr/" target="_blank">CMLA</a>, ENS de Cachan<br>tel. CMLA : 01-47-40-59-42<br>tel. portable : 06-87-39-58-26<br>
web  : <a href="http://www.tsi.enst.fr/%7Erabin/" target="_blank">http://www.tsi.enst.fr/~rabin/</a><br>