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

Home » Public Forums » archive » Device's bits_per_pixel keyword
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
Device's bits_per_pixel keyword [message #13455] Wed, 11 November 1998 00:00 Go to next message
Charles Cavanaugh is currently offline  Charles Cavanaugh
Messages: 8
Registered: July 1997
Junior Member
<HTML>
I have a program that generates color postscript plots, and I want to make
the files
<BR>smaller.&nbsp; I have tried :

<P>set_plot, 'PS'
<BR>device, bits_per_pixel = 2
<BR>.
<BR>.
<BR>.
<BR>device, /close

<P>but the file generated is only very slightly smaller than when I do
not use the
<BR>bits_per_pixel keyword.&nbsp; I've also tried bits_per_pixel = 1, 4
and 8, but the file
<BR>size change is so very slight (and in some cases larger then when the
keyword
<BR>is not used).

<P>If anyone has been able to generate considerably smaller postscript
files by using
<BR>the bits_per_pixel keyword, please let me know how to do that.&nbsp;
Thank you.

<P>I'm using IDL 5.1 on an SGI workstation running IRIX 6.5.1.
<BR>&nbsp;

<P>Charles
<PRE>--&nbsp;
Charles Cavanaugh
MOPITT &amp; HIRDLS Programs
National Center for Atmospheric Research
Boulder, CO, USA
email: cavanaug@ucar.edu
phone: (303) 497-2919
fax&nbsp; : (303) 497-2920</PRE>
&nbsp;</HTML>
Re: Device's bits_per_pixel keyword [message #13516 is a reply to message #13455] Fri, 13 November 1998 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Harald Frey <hfrey@ssl.berkeley.edu> writes:

> bits_per_pixel has nothing to do with the size of the PS output, it is
> just the number of bits that is adjusted to each pixel and allows
> display in black/white or in any of 255 grey-levels. You have to use the
> xsize and ysize keywords.

> set_plot,'ps'
> device,xsize=15.,ysize=15.,xoffset=3.,yoffset=5.,scale_facto r=1.,bits=8,/color

> .
> .
> device,/close


I think there's some confusion over the word "size" here. The above commands
will affect the size of the plot on the page, but will have no effect on how
much disk space the file takes up. BITS_PER_PIXEL does have an effect on the
file size, but only for greyscale rendering, as discussed in my previous
posting.

William Thompson
Re: Device's bits_per_pixel keyword [message #13517 is a reply to message #13455] Fri, 13 November 1998 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Charles Cavanaugh <cavanaug@nicole.eos.ucar.edu> writes:


> --------------9F3C599E53254C11EEDF762F
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

> I have a program that generates color postscript plots, and I want to make the files
> smaller. I have tried :

> set_plot, 'PS'
> device, bits_per_pixel = 2
> .
> .
> .
> device, /close

> but the file generated is only very slightly smaller than when I do not use the
> bits_per_pixel keyword. I've also tried bits_per_pixel = 1, 4 and 8, but the file
> size change is so very slight (and in some cases larger then when the keyword
> is not used).

> If anyone has been able to generate considerably smaller postscript files by using
> the bits_per_pixel keyword, please let me know how to do that. Thank you.

> I'm using IDL 5.1 on an SGI workstation running IRIX 6.5.1.


The BITS_PER_PIXEL keyword can be used to generate smaller PostScript files, in
the sense of how much disk space the file takes up. For example, here are the
file sizes of two otherwise identical PostScript files, where bit_per_pixel=8
for the first one and bits_per_pixel=2 for the second one:

-rw-rw-r-- 1 thompson users 2020755 Nov 13 17:27 idl.ps
-rw-rw-r-- 1 thompson users 508255 Nov 13 17:28 idl2.ps

The second file is almost four times smaller, as one would expect. However,
this saving is only realizable for images displayed through TV or TVSCL, or any
other routine which works through shade-rendering. There are no savings to be
made for line-drawn graphics. Also, this savings in disk space comes at a
price. With only 2 bits/pixel, it's only possible to show 4 colors at a time.
(Or 4 shades in each of red, green, and blue for true-color images.) That's a
pretty drastic reduction in image quality.

(This is the case for direct graphics--I'm not sure what the effect would be
for object graphics, but expect the same principles would apply.)

William Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Unknown #INFO
Next Topic: Unknown #INFO

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

Current Time: Wed Oct 08 19:22:16 PDT 2025

Total time taken to generate the page: 0.00717 seconds