« Return to Thread: Can't set background color in 4.2.5 on jpeg terminal

Re: Can't set background color in 4.2.5 on jpeg terminal

by rodgilchrist :: Rate this Message:

Reply to Author | View in Thread

Perfect Thomas, thank you. Both gif and png terminals work.
Also the jpeg comment is right on.

Can I suggest that this is a bug in the jpeg terminal that I believe could be fixed by
changing line 1360 in gd.trm (PNG_graphics()) from:

        rgb = gdImageColorAllocate(png_state.image, 255, 255, 255);

to
        rgb = png_state.rgb_table[0];
        rgb = gdImageColorAllocate(png_state.image, (rgb >> 16) & 0xff, (rgb >> 8) & 0xff, rgb & 0xff);

The 'terminal jpeg' statement is loading the background color entry. Might as well just use it instead of a fixed white color.


- Rod



has something to do with the fact that the gd-library
sets the background to black for truecolor graphics.
this is repaired by gnuplot's gd terminal by drawing
a white background and then plotting over it.
but the old mechnism for non-truecolor graphics (1st
color is background color) doesn't work anymore.

 « Return to Thread: Can't set background color in 4.2.5 on jpeg terminal