R logo as SVG ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

R logo as SVG ?

Jens Elkner
Hi,

does anybody have the R logo in a vector format preferable SVG?
Need it for Freedesktop (GNOME desktop) integration of Rcmdr ...

Thanx,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Peter Dalgaard
Jens Elkner wrote:
> Hi,
>
> does anybody have the R logo in a vector format preferable SVG?
> Need it for Freedesktop (GNOME desktop) integration of Rcmdr ...
>
> Thanx,
> jel.

Not really. I played around with the tracer in inkscape at some point,
but it didn't come out quite satisfactory. It's a bit of a time sink
unless you happen to know inkscape (or similar) rather well, but if
someone is willing to put in the effort, I'm sure the results would be
more than welcome on CRAN.


--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

G. Jay Kerns
On Sat, Feb 20, 2010 at 1:18 PM, Peter Dalgaard
<[hidden email]> wrote:

> Jens Elkner wrote:
>>
>> Hi,
>>
>> does anybody have the R logo in a vector format preferable SVG?
>> Need it for Freedesktop (GNOME desktop) integration of Rcmdr ...
>>
>> Thanx,
>> jel.
>
> Not really. I played around with the tracer in inkscape at some point, but
> it didn't come out quite satisfactory. It's a bit of a time sink unless you
> happen to know inkscape (or similar) rather well, but if someone is willing
> to put in the effort, I'm sure the results would be more than welcome on
> CRAN.
>
>

As it happens, I made one with Inkscape a couple of months ago.  If
memory serves, I did 50 scans of the .png.

http://people.ysu.edu/~gkerns/R-logo.svg

Hope it is useful to you.
Jay






***************************************************
G. Jay Kerns, Ph.D.
Associate Professor
Department of Mathematics & Statistics
Youngstown State University
Youngstown, OH 44555-0002 USA
Office: 1035 Cushwa Hall
Phone: (330) 941-3310 Office (voice mail)
-3302 Department
-3170 FAX
VoIP: [hidden email]
E-mail: [hidden email]
http://people.ysu.edu/~gkerns/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Peter Dalgaard
G. Jay Kerns wrote:

> On Sat, Feb 20, 2010 at 1:18 PM, Peter Dalgaard
> <[hidden email]> wrote:
>> Jens Elkner wrote:
>>> Hi,
>>>
>>> does anybody have the R logo in a vector format preferable SVG?
>>> Need it for Freedesktop (GNOME desktop) integration of Rcmdr ...
>>>
>>> Thanx,
>>> jel.
>> Not really. I played around with the tracer in inkscape at some point, but
>> it didn't come out quite satisfactory. It's a bit of a time sink unless you
>> happen to know inkscape (or similar) rather well, but if someone is willing
>> to put in the effort, I'm sure the results would be more than welcome on
>> CRAN.
>>
>>
>
> As it happens, I made one with Inkscape a couple of months ago.  If
> memory serves, I did 50 scans of the .png.
>
> http://people.ysu.edu/~gkerns/R-logo.svg
>
> Hope it is useful to you.
> Jay
>
>

Thanks. Certainly looks better than what I had left around. A full
megabyte might be a bit much for a desktop icon, though.

--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
On Sat, Feb 20, 2010 at 08:00:13PM +0100, Peter Dalgaard wrote:

> G. Jay Kerns wrote:
> >On Sat, Feb 20, 2010 at 1:18 PM, Peter Dalgaard
> ><[hidden email]> wrote:
> >>Jens Elkner wrote:
> >>>Hi,
> >>>
> >>>does anybody have the R logo in a vector format preferable SVG?
> >>>Need it for Freedesktop (GNOME desktop) integration of Rcmdr ...
> >>>
> >>>Thanx,
> >>>jel.
> >>Not really. I played around with the tracer in inkscape at some point, but
> >>it didn't come out quite satisfactory. It's a bit of a time sink unless
> >>you
> >>happen to know inkscape (or similar) rather well, but if someone is
> >>willing
> >>to put in the effort, I'm sure the results would be more than welcome on
> >>CRAN.
> >>
> >>
> >
> >As it happens, I made one with Inkscape a couple of months ago.  If
> >memory serves, I did 50 scans of the .png.
> >
> >http://people.ysu.edu/~gkerns/R-logo.svg
 
OK - thanx. Good source for studying its structure.

> Thanks. Certainly looks better than what I had left around. A full
> megabyte might be a bit much for a desktop icon, though.

Yes and scaling would be too resource consuming as well (very bad for
menus, etc.). I think, the most challenging part here is all the
[different type of] shadows. So does anybody know, who made  the
original pixel based image? If not raytraced and steps for reproduction
are available (e.g. gimp/psp layers), it should be possible to produce a
less resource consuming but pretty close svg (at least at the given size
;-)).

Regards,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Barry Rowlingson
On Sat, Feb 20, 2010 at 7:56 PM, Jens Elkner <[hidden email]> wrote:

> Yes and scaling would be too resource consuming as well (very bad for
> menus, etc.). I think, the most challenging part here is all the
> [different type of] shadows. So does anybody know, who made  the
> original pixel based image? If not raytraced and steps for reproduction
> are available (e.g. gimp/psp layers), it should be possible to produce a
> less resource consuming but pretty close svg (at least at the given size

A while ago I played around with creating a new R logo using vector
graphics. I took the current logo as a starting point. Here's some
samples on different coloured backgrounds:

http://www.maths.lancs.ac.uk/~rowlings/Graphics/Logo/R/logos.svg

I figured maybe for R 3.0 it would be cool to have an R made from a 1
and a 2....

Barry

--
blog: http://geospaced.blogspot.com/
web: http://www.maths.lancs.ac.uk/~rowlings
web: http://www.rowlingson.com/
twitter: http://twitter.com/geospacedman
pics: http://www.flickr.com/photos/spacedman

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

baptiste auguie-5
On 21 February 2010 14:48, Barry Rowlingson
<[hidden email]> wrote:

> A while ago I played around with creating a new R logo using vector
> graphics. I took the current logo as a starting point. Here's some
> samples on different coloured backgrounds:
>
> http://www.maths.lancs.ac.uk/~rowlings/Graphics/Logo/R/logos.svg
>
> I figured maybe for R 3.0 it would be cool to have an R made from a 1
> and a 2....
>

That's funny, when I saw your logo yesterday in google images I didn't
see the 1 and 2 but rather thought it was showing a lambda for some
reason.

Personally, I've always been curious to unravel the elliptical
construction hidden in that grey area surrounding R.  That'd be a nice
side-effect of having a 3D model in povray (*); we could rotate it and
see the other side. Sadly I don't have the skill. I wonder if RGL or
Blender could make this easier yet still reproducible.

Best,

baptiste

(*) a neat example is at: http://www.imagico.de/pov/icons.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
In reply to this post by Jens Elkner
On Mon, Feb 22, 2010 at 01:14:51PM +0100, Peter Dalgaard wrote:
Hi Peter,
 
sorry for the later answer - had to finish other tasks first :(

> I played around with inkscape again (& it IS a time sink...) The
> attached version is around 200K and not too bad looking to my eyes. How
> does it work for your purposes?

Yes - still a little bit big (most are usually not bigger than 50K, but
some exceptions hav 80..100K), but much better than 2M and sufficient
IMHO, too.

Installed the package (see
http://dev.cs.uni-magdeburg.de/lnf/i386/R/LNFr-desktop/ ) -> looks
ok in the GNOME menu and nautilus. If you want to test it yourself
on Linux or Solaris (procedure is the same for freedesktops aka Solaris
and Linux ;-)), copy the 3 files to the same location and call
update-desktop-database ; update-mime-database $instdir/share/mime

Than the menu entries appear immediately in the GNOME application menu
(nautilus needs to be restarted to get the "news" aka icon displayed
for *.R).

Currently the last thing I'm thinking about is: "with '-g Tk' start
Rcmdr if available, otherwise tkStartGUI()". Would you mind to integrate
that into the official R tree? I know, its more or less easy to modify
library/tcltk/exec/Tk-frontend.R, however admins as well as package
creators/maintainers don't like, when one package modifies the content
of another one and have to keep track of changes, i.e. need to do more
or less "sophisticated" things, when they get removed ...

Regards and thanx,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Peter Dalgaard
Jens Elkner wrote:

> On Mon, Feb 22, 2010 at 01:14:51PM +0100, Peter Dalgaard wrote:
> Hi Peter,
>  
> sorry for the later answer - had to finish other tasks first :(
>
>> I played around with inkscape again (& it IS a time sink...) The
>> attached version is around 200K and not too bad looking to my eyes. How
>> does it work for your purposes?
>
> Yes - still a little bit big (most are usually not bigger than 50K, but
> some exceptions hav 80..100K), but much better than 2M and sufficient
> IMHO, too.

[AFAIR, this didn't go via r-devel, so people here won't have seen it
before]

I suppose I should put it somewhere for others to play with. It should
be possible to reduce the number of colour layers and get down to  the
50 K or so, but it is quite fiddly. I found that if you put inkscape in
"outline mode", then you can manipulate the Bezier curves directly and
get rid of the artifacts from the bitmap tracing. Currently, it has
about 64 paths of about 60 control points each, so it might be a better
strategy to start over with a coarser trace.

>
> Installed the package (see
> http://dev.cs.uni-magdeburg.de/lnf/i386/R/LNFr-desktop/ ) -> looks
> ok in the GNOME menu and nautilus. If you want to test it yourself
> on Linux or Solaris (procedure is the same for freedesktops aka Solaris
> and Linux ;-)), copy the 3 files to the same location and call
> update-desktop-database ; update-mime-database $instdir/share/mime
>
> Than the menu entries appear immediately in the GNOME application menu
> (nautilus needs to be restarted to get the "news" aka icon displayed
> for *.R).

Mmm, I'm changing jobs on Monday and I expect to be out cold for a
while, switching computer platform and getting up to speed in general.
Any chance of a couple of screenshots?

> Currently the last thing I'm thinking about is: "with '-g Tk' start
> Rcmdr if available, otherwise tkStartGUI()". Would you mind to integrate
> that into the official R tree? I know, its more or less easy to modify
> library/tcltk/exec/Tk-frontend.R, however admins as well as package
> creators/maintainers don't like, when one package modifies the content
> of another one and have to keep track of changes, i.e. need to do more
> or less "sophisticated" things, when they get removed ...

This sounds a bit far-reaching. The "-g Tk" route is a bit of a kludge
already, so everything is in for a review and I'd rather not build
things on top of a crumbling foundation.

You might be able to do something with environment variables and
.Rprofile files instead. (I was about to suggest 'R -e something' but
Rcmdr refuses to start in a non-interactive session).

>
> Regards and thanx,
> jel.


--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
On Sat, Feb 27, 2010 at 10:18:23AM +0100, Peter Dalgaard wrote:
> Jens Elkner wrote:
...
> >Yes - still a little bit big (most are usually not bigger than 50K, but
> >some exceptions hav 80..100K), but much better than 2M and sufficient
> >IMHO, too.
...
> I suppose I should put it somewhere for others to play with. It should

Yes, good idea!

> be possible to reduce the number of colour layers and get down to  the
> 50 K or so, but it is quite fiddly. I found that if you put inkscape in
> "outline mode", then you can manipulate the Bezier curves directly and
> get rid of the artifacts from the bitmap tracing. Currently, it has
> about 64 paths of about 60 control points each, so it might be a better
> strategy to start over with a coarser trace.

Well, as said, for my taste it is good enough. However, to get a real
small good one, I think it should be made from scratch and not based
on a scanned pixmap. BTW: What do you think about Baptiste's work (
http://www.maths.lancs.ac.uk/~rowlings/Graphics/Logo/R/logos.svg )?
IMHO looks cool, sharp, modern and simple enough to be used in any
vector drawing program efficiently.
 
> >http://dev.cs.uni-magdeburg.de/lnf/i386/R/LNFr-desktop/ ) -> looks
> >update-desktop-database ; update-mime-database $instdir/share/mime
...
> Any chance of a couple of screenshots?
 
Yes, can make them on monday at work. @home I have to use a macbook
right now :( (my Linux WS died few month ago and 've had not yet the time
to look for a new motherboard and stuff ...)

> >Currently the last thing I'm thinking about is: "with '-g Tk' start
> >Rcmdr if available, otherwise tkStartGUI()". Would you mind to integrate
> >that into the official R tree? I know, its more or less easy to modify
> >library/tcltk/exec/Tk-frontend.R, however admins as well as package
> >creators/maintainers don't like, when one package modifies the content
> >of another one and have to keep track of changes, i.e. need to do more
> >or less "sophisticated" things, when they get removed ...
>
> This sounds a bit far-reaching. The "-g Tk" route is a bit of a kludge
> already, so everything is in for a review and I'd rather not build
> things on top of a crumbling foundation.

Yes, actually I though about something generic as well: e.g. an etc/gui
directory where everybody may put the startup files for the GUI like
  etc/gui/
          Tk.R
          Rcmdr.R
          ...

So "R -g {Tk|Rcmdr}" would be valid ... However, AFAIK these are the
only GUIs, which can be lunched from R. All others are embedding R, so
the add. work might not be worth it.
 
> You might be able to do something with environment variables and
> .Rprofile files instead.

That's not an option for desktop integration - having to manipulate each
user's profile is certainly a really bad thing.

> (I was about to suggest 'R -e something' but
> Rcmdr refuses to start in a non-interactive session).

Yes,   echo "library('Rcmdr')" | R --interactive...   doesn't work
either, because it than goes crazy (looks like a kind of BATCH mode).

BTW OT: wondering why one just can't pipe its script into R. IMHO it
should be possible and after having the code processed it should stay in
interactive mode (giving an R prompt) so that one may continue to work.
Only if CMD BATCH or something like that is given, it should auto exit.
The "Fatal error: you must specify '--save', '--no-save' or '--vanilla'"
is IMHO completely non-sense, since everybody is able to start simply
'R' (i.e. no option at all) and enter stuff. Actually normal progs
don't really care, where the input comes from ...

Anyway, will be back on monday with some screenshots ...

Regards,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

baptiste auguie-5
You got the first two letters right, but it's actually *Barry*'s work!

As a matter of personal taste, I like the 3D rendering of the current
logo; my only wish would be for an open source to reproduce it.

baptiste

On 27 February 2010 19:55, Jens Elkner <[hidden email]> wrote:

> BTW: What do you think about Baptiste's work (
> http://www.maths.lancs.ac.uk/~rowlings/Graphics/Logo/R/logos.svg )?
> IMHO looks cool, sharp, modern and simple enough to be used in any
> vector drawing program efficiently.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
On Sat, Feb 27, 2010 at 08:23:17PM +0100, baptiste auguie wrote:
> You got the first two letters right, but it's actually *Barry*'s work!
 
Oh - sorry, Barry!!!

BTW: screenshots I made from my desktop are available via
http://iws.cs.uni-magdeburg.de/~elkner/r/

OT: Incl. the iconv patch I used for Solaris, since I prefer its
libiconv 'fail fast' instead of the GNU libiconvs 'perhaps I can
produce something usable' approach ...

Regards,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Peter Dalgaard
Jens Elkner wrote:

> On Sat, Feb 27, 2010 at 08:23:17PM +0100, baptiste auguie wrote:
>> You got the first two letters right, but it's actually *Barry*'s work!
>  
> Oh - sorry, Barry!!!
>
> BTW: screenshots I made from my desktop are available via
> http://iws.cs.uni-magdeburg.de/~elkner/r/
>
> OT: Incl. the iconv patch I used for Solaris, since I prefer its
> libiconv 'fail fast' instead of the GNU libiconvs 'perhaps I can
> produce something usable' approach ...
>
> Regards,
> jel.
Looks quite nice. I later realized that it would be a much better idea
to start by tracing the highest resolution bitmap from

http://developer.r-project.org/Logo

I now have a version that is only 48 K. It still needs a little touching
up to get a transparent background without destroying the highlighted
regions. I'm attaching it here, but it might not make it to r-devel.

--
    O__  ---- Peter Dalgaard
   c/ /'_ --- Center for Statistics
  (*) \(*) -- Copenhagen Business School
~~~~~~~~~~ -

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Peter Dalgaard
Peter Dalgaard wrote:

> Jens Elkner wrote:
>> On Sat, Feb 27, 2010 at 08:23:17PM +0100, baptiste auguie wrote:
>>> You got the first two letters right, but it's actually *Barry*'s work!
>>   Oh - sorry, Barry!!!
>>
>> BTW: screenshots I made from my desktop are available via
>> http://iws.cs.uni-magdeburg.de/~elkner/r/
>>
>> OT: Incl. the iconv patch I used for Solaris, since I prefer its
>> libiconv 'fail fast' instead of the GNU libiconvs 'perhaps I can
>> produce something usable' approach ...
>>
>> Regards,
>> jel.
>
> Looks quite nice. I later realized that it would be a much better idea
> to start by tracing the highest resolution bitmap from
>
> http://developer.r-project.org/Logo
>
> I now have a version that is only 48 K. It still needs a little touching
> up to get a transparent background without destroying the highlighted
> regions. I'm attaching it here, but it might not make it to r-devel.

Didn't...

Should be making its way to developer.r-project.org now. Or for the
impatient:

http://svn.r-project.org/R-dev-web/trunk/Logo/

--
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

G. Jay Kerns
On Mon, Mar 1, 2010 at 4:16 PM, Peter Dalgaard <[hidden email]> wrote:

>>
>> Looks quite nice. I later realized that it would be a much better idea to
>> start by tracing the highest resolution bitmap from
>>
>> http://developer.r-project.org/Logo
>>
>> I now have a version that is only 48 K. It still needs a little touching
>> up to get a transparent background without destroying the highlighted
>> regions. I'm attaching it here, but it might not make it to r-devel.
>
> Didn't...
>
> Should be making its way to developer.r-project.org now. Or for the
> impatient:
>
> http://svn.r-project.org/R-dev-web/trunk/Logo/
>

Wow!  That really looks great.  And at 5% of the size of mine, to
boot.  I spent some minutes trying to make mine smaller but could only
get it to ~850k.

Jay

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
In reply to this post by Peter Dalgaard
On Mon, Mar 01, 2010 at 10:16:16PM +0100, Peter Dalgaard wrote:
> >Jens Elkner wrote:
...
> >>BTW: screenshots I made from my desktop are available via
> >>http://iws.cs.uni-magdeburg.de/~elkner/r/
...
> >Looks quite nice. I later realized that it would be a much better idea
> >to start by tracing the highest resolution bitmap from
> >
> >http://developer.r-project.org/Logo
> >
> >I now have a version that is only 48 K. It still needs a little touching
> >up to get a transparent background without destroying the highlighted
> >regions. I'm attaching it here, but it might not make it to r-devel.

Good work!!!

Still looks ok for me (so less is more ;-)). Added screenshots to
the URL above (new 49K based ones have a '2' at the end). For your
convinience/easier comparision I tied them together:
http://iws.cs.uni-magdeburg.de/~elkner/r/menu.html
http://iws.cs.uni-magdeburg.de/~elkner/r/nautilus.html

Regards,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Henrik Bengtsson
My Wednesday procrastination:

There's quite some number of decimals in the SVG and some whitespace,
so some dummy trimming gives:

x <- readLines("http://developer.r-project.org/Logo/Rlogo-1.svg");
nx <- sum(nchar(x))+length(x);

for (kk in 2:0) {
  # Keep only K decimals
  pattern <- sprintf("([0-9]+)\\.([0-9]{%d})([0-9]*)", kk);
  y <- gsub(pattern, "\\1.\\2", x);
  # Drop trailing zeros
  y <- gsub("([0-9]+)\\.([1-9]+)(0+)([^0])", "\\1.\\2\\4", y);
  # Drop trailing periods
  y <- gsub("([0-9]+)\\.([, \"])", "\\1\\2", y);
  # Trim white space
  y <- gsub("^[ ]+", "", y);
  y <- gsub("[ ]+\\/>", "/>", y);

  # Keep first line as is
  y[1] <- x[1];
  # Write to file
  pathname <- sprintf("Rlogo-1,trimmed,%d.svg", kk);
  bfr <- paste(y, collapse="\n");
  bfr <- charToRaw(bfr);
  ny <- length(bfr);
  writeBin(bfr, con=pathname);
  cat(sprintf("%d bytes (%.1f%%)\n", ny, 100*ny/nx));
} # for (kk ...)

gives

36694 bytes (74.3%)
32766 bytes (66.3%)
23981 bytes (48.5%)

Not easy to see any differences between these and the original one.

/Henrik

On Tue, Mar 2, 2010 at 5:46 PM, Jens Elkner <[hidden email]> wrote:

> On Mon, Mar 01, 2010 at 10:16:16PM +0100, Peter Dalgaard wrote:
>> >Jens Elkner wrote:
> ...
>> >>BTW: screenshots I made from my desktop are available via
>> >>http://iws.cs.uni-magdeburg.de/~elkner/r/
> ...
>> >Looks quite nice. I later realized that it would be a much better idea
>> >to start by tracing the highest resolution bitmap from
>> >
>> >http://developer.r-project.org/Logo
>> >
>> >I now have a version that is only 48 K. It still needs a little touching
>> >up to get a transparent background without destroying the highlighted
>> >regions. I'm attaching it here, but it might not make it to r-devel.
>
> Good work!!!
>
> Still looks ok for me (so less is more ;-)). Added screenshots to
> the URL above (new 49K based ones have a '2' at the end). For your
> convinience/easier comparision I tied them together:
> http://iws.cs.uni-magdeburg.de/~elkner/r/menu.html
> http://iws.cs.uni-magdeburg.de/~elkner/r/nautilus.html
>
> Regards,
> jel.
> --
> Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
> Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
> 39106 Magdeburg, Germany         Tel: +49 391 67 12768
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R logo as SVG ?

Jens Elkner
On Wed, Mar 03, 2010 at 05:42:24PM +0100, Henrik Bengtsson wrote:
Hi Henrik,

> My Wednesday procrastination:
>
> There's quite some number of decimals in the SVG and some whitespace,
> so some dummy trimming gives:
>
> x <- readLines("http://developer.r-project.org/Logo/Rlogo-1.svg");
...
Cool :). However, wrt. ressource consumption when the image gets
loaded/rendered, I think there is no noticable gain. But anyway,
reducing the package size is always a good thing :) !

Thanx,
jel.
--
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 12768

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel