diff --git a/src/demo/boxdemo.c b/src/demo/boxdemo.c index 14cc56c6a..671b04ef2 100644 --- a/src/demo/boxdemo.c +++ b/src/demo/boxdemo.c @@ -18,8 +18,8 @@ int box_demo(struct notcurses* nc){ } struct timespec start, now; clock_gettime(CLOCK_MONOTONIC, &start); - int zbonus = 0; - int zbonusdelta = 16; + int zbonus = 40; + int zbonusdelta = 20; int ylen, xlen; ncplane_dim_yx(n, &ylen, &xlen); // target grid is 7x7 diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index d9d19fa33..1a89da781 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1718,7 +1718,8 @@ rgb_greyscale(int r, int g, int b){ if(b < 0 || b > 255){ return -1; } - float fg = (0.2126 * (r / 255.0) + 0.7152 * (g / 255.0) + 0.0722 * (b / 255.0)); + // Use Rec. 601 scaling plus linear approximation of gamma decompression + float fg = (0.299 * (r / 255.0) + 0.587 * (g / 255.0) + 0.114 * (b / 255.0)); return fg * 255; } @@ -1729,7 +1730,6 @@ void ncplane_greyscale(ncplane *n){ cell* c = &n->fb[nfbcellidx(n, y, x)]; unsigned r, g, b; cell_fg_rgb(c, &r, &g, &b); - // Use Rec. 601 scaling int gy = rgb_greyscale(r, g, b); cell_set_fg_rgb(c, gy, gy, gy); cell_bg_rgb(c, &r, &g, &b);