comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » graphic functions - CopyWindow()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
graphic functions - CopyWindow() [message #94794] Mon, 16 October 2017 05:31 Go to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
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)]
Re: graphic functions - CopyWindow() [message #94795 is a reply to message #94794] Mon, 16 October 2017 08:51 Go to previous message
wlandsman is currently offline  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)]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: extract circle from data with idl
Next Topic: Map projection of IMAGE() is behaving strangely...

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:25:29 PDT 2025

Total time taken to generate the page: 0.00454 seconds