--- psiconv/trunk/lib/psiconv/generate_image.c 2004/02/25 20:57:10 231 +++ psiconv/trunk/lib/psiconv/generate_image.c 2014/10/22 19:53:40 351 @@ -1,6 +1,6 @@ /* generate_image.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 1999-2004 Frodo Looijaard + Copyright (c) 1999-2014 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -266,7 +266,7 @@ << bluebits) + ((psiconv_u32) (p_blue * (1 << bluebits) + 0.5)); else - pixel = (p_red + p_green + p_blue)/3.0 * (1 << colordepth); + pixel = (0.212671 * p_red + 0.715160 * p_green + 0.072169 * p_blue) * ((1 << colordepth) * 0.999); } else { dist = 4; /* Max distance is 3, so this is safe */ pixel = -1; @@ -334,7 +334,7 @@ outputbytenr = 0; for (x = 0; x < xsize; x++) { if (!(pixelptr = psiconv_list_get(pixels,y*xsize+x))) { - psiconv_error(config,lev,0,"Massive internal corruption"); + psiconv_error(config,lev,0,"Data structure corruption"); res = -PSICONV_E_NOMEM; goto ERROR2; } @@ -960,4 +960,3 @@ psiconv_progress(config,lev,0,"End of jumptable section"); return res; } -