Regarding R's png device in linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding R's png device in linux

Anshul Gupta





Hi,
I am a developer from Oracle. I wanted to create a png file out of png device with a bit depth of 8.  I am using R on linux. But I noticed that R automatically switches between 8 and 24 bit depth. i tried a lot of things from your grDevices package but unable to control the bitdepth. I would be really grateful to you guys if you can suggest me some way to solve this issue.

-/Ag

Anshul Gupta
Mobile : +91-814773074
Linkedin : http://in.linkedin.com/pub/anshul-gupta/19/b36/4a7 
Personal Website : http://www.guptaanshul.com


"When we are dreaming alone it is only a dream. When we are dreaming with others, it is the beginning of reality." -- Dom Helder Camara
                 
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Regarding R's png device in linux

Prof Brian Ripley
On 10/10/2012 07:23, Anshul Gupta wrote:
>
> Hi,
> I am a developer from Oracle. I wanted to create a png file out of
> png
device with a bit depth of 8. I am using R on linux. But I noticed that
R automatically switches between 8 and 24 bit depth. i tried a lot of
things from your grDevices package but unable to control the bitdepth. I
would be really grateful to you guys if you can suggest me some way to
solve this issue.

Let me read the help page to you ...

      ‘png’ will normally use a palette if there are less than 256
      colours on the page, and record a 24-bit RGB file otherwise (or a
      32-bit RGBA file if ‘type = "cairo"’ and non-opaque colours are
      used).  ...

So, it is obvious that you need to use less than 256 colours (which is
all PNG8 can support: it is not a 'bit depth' as it uses a palette).

> -/Ag
>
> Anshul Gupta
> Mobile : +91-814773074
> Linkedin : http://in.linkedin.com/pub/anshul-gupta/19/b36/4a7
> Personal Website : http://www.guptaanshul.com


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.