Re: graphic functions - CopyWindow() [message #94795 is a reply to message #94794] |
Mon, 16 October 2017 08:51  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
This doesn't help with your goal of reducing file size, but using a larger output window better preserves the binary colortable For example, with a 8192 x 8192 output window, 99.9% of the pixels will have a value of either 0 or 255.
IDL> p=plot(/test)
IDL> hfg =histogram(p.CopyWindow(height=8192,width=8192))
IDL> print,(hfg[0] + hfg[255])/total(hfg)
0.999231
You could always force a bifurcation For example, pixel values greater than 128 are background, and values lower than 128 are graphics.
--Wayne
On Monday, October 16, 2017 at 8:31:44 AM UTC-4, Markus Schmassmann wrote:
> Hi,
>
> as illustrated in the code below, when I make a plot in direct graphics
> all the pixels have either the background color or the plotted color,
> but when I use graphic functions and then retrieve the screen with
> COPYWINDOW() the colors of the pixels are all over the greyscale.
> Setting antiAlias=0 doesn't help either.
>
> Is there a way to retrieve a graphic function screen without expanding
> the colortable beyond what originally went into it for plotting?
>
> I hope that by reducing the colortable I can reduce the file size of a
> video I create using the COPYWINDOW() method.
>
> Thanks for any help,
> Markus
>
>
> p=plot(/test)
> hfg =histogram(p.CopyWindow())
> hfg2=histogram(p.CopyWindow(antiAlias=0))
> device,decomposed=1
> plot, hfg>.2,/ylog,background='FFFFFF'x,color=0
> oplot, hfg2>.2,color=0
> hdg=histogram(tvrd())
> print, [hdg[[0,255]],total(hdg[1:254],/int)]
|
|
|