|
From: Ethan M. <merritt@u.washington.edu> - 2005-08-18 19:30:39
|
On Wednesday 17 August 2005 12:03 pm, Ethan Merritt wrote:
> Ah. You may be right about that. The postscript driver tries to offload
> the gray->rgb calculation into print-time PostScript code; this makes for
> a shorter output file but slower evaluation by the postscript device, and
> apparently introduces an opportunity for substantial roundoff error.
Just to prove the point -
The small patch below forces the gray->rgb conversion to happen in the
driver, rather than in the PostScript code. With this patch in place,
the postscript output looks the same as the png truecolor output.
diff -ur gnuplot/term/post.trm gnuplot-cvs/term/post.trm
--- gnuplot/term/post.trm 2005-08-07 18:21:52.000000000 -0700
+++ gnuplot-cvs/term/post.trm 2005-08-17 16:03:53.408922728 -0700
@@ -3371,7 +3371,16 @@
if (gray >= 1)
fputs("1 g ", gppsfile);
else
+#if (0)
fprintf(gppsfile, "%s g ", save_space(gray));
+#else
+ {
+ rgb_color color;
+ rgb1_from_gray(gray, &color);
+ fprintf(gppsfile, "%5.3f %5.3f %5.3f setrgbcolor ",
+ color.r, color.g, color.b);
+ }
+#endif
}
PS_relative_ok = FALSE; /* "M" required because "g" forces stroke (??) */
}
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|