David Fanning wrote:
> [ M. Kelly writes:
>
>> Hello, I know this subject has (had) come up many times for over a
>> decade, and from what I can
>> tell on this newsgroup, seemed to be worked out to a great extent by
>> say 2004.
>>
>> My problem is a 'classic' (?) where color postscript output is only 16
>> colors. That is, I'm
>> trying to make a Postscript color image, but I get 'blocky' colors -
>> i.e., only 16 of them.
>>
>> But the twist (or me missing something) is that
>> 1) I am using David Fanning's flexible TVIMAGE program (thanks!
>> great prog btw),
>> and
>> 2) I explicitly set DEVICE, BITS=8, COLOR=1, ENCAPSULATED=1 after
>> doing SET_PLOT,'ps'.
>>
>> A curious thing, though: using Fanning's COLORBAR program produces
>> 256-color output on the
>> Postscript plot, so the bar looks nice and the plot is
>> crude/blocky/pixelly/ick. Also, doing a LOADCT
>> after setting to PS output does not help.
>>
>> Could anyone help or offer any suggestions for this seemingly
>> ancient/solved problem? ]
>
> Humm. If everything is as you say it is, and COLORBAR
> works correctly, then I would say the problem is with
> your image. Does your program work correctly on your
> display? I would guess your image is not byte scaled,
> from the available evidence. (I would like to see the
> code, however.)
The program works correctly on my X11 display, so I had actually
been writing it to a png file and using ImageMagick ('convert') to
make Postscript files. {Not bad, except for publications (and
dissertation), the fonts are kinda marginal (no pun intended). }
Thanks so much for your response (as well as the great progs
you've made); here is a code example I used to generate a plot
which can be converted to white-on-black Postscript:
TVImage, BYTSCL(wavgy[*,0:nz/06],MIN=-w_amp,MAX=w_amp), /ERASE, $
POSITION=[.12,.12,.8,.9], /MINUS_ONE, BACKGROUND=-1
contour, wavgy[*,0:nz/06], x, z[0:nz/06], xtitle="x (m)", ytitle="z
(m)", $
title=textoidl('vertical velocity field (ms^{-1}),
\alpha_{fall}=0.5'), $
chars=1.5, /NODATA, /NOERASE, POS=[.12,.12,.8,.9], color=0
colorbar, /vertical, /right, NCOLORS=256,
POSITION=[0.83,0.15,0.85,0.85], $
RANGE=[-w_amp,w_amp],DIVISIONS=4, charsize=1.5, FORMAT='(F6.2)',
color=0
(the PNG file is then saved using your SAVEIMAGE prog, and converted
using
the -white-threshold and other options with the ImageMagick/convert
linux goodie).
thanks again, much and mucho,
-Mark
|