Re: [S] binary _to_jpg

Prof Brian Ripley (
Thu, 23 Jul 1998 16:04:47 +0100 (BST)

> From:
> Date: Thu, 23 Jul 98 10:29:23 -0500
> Subject: [S] binary _to_jpg
> To:
> Dear S'ersPLUS!:
> Many thanks to Thomas Schmugge, Prof. Brian Ripley and especially to Bob
> for fast response. Now I inderstand that the obstacle for transition from
> to JPG is that S_plus does not handle one-bite data (so far, of course!)

byte, I hope. Svr4 and therefore S-PLUS 5 has a raw data type, but
I still would not use S-PLUS.

> Therefore, I want to slightly simplify the task. I transform binary matrix
> the 3-digits integer matrix outside S-plus (using, say, a FORTRAN module
> launched from S-PLUS). How to proceed from this point?
> What I need is an entirely automatic procedure without any keyboard
> interventions (INPUT: a million of binary files, OUTPUT: a million of
> files)
> I work with S+3.3/4.5 on Pentium2/400MGz/128RAM under W95/98

As I said before privately I think the solution is just to launch an
external convertor. Why re-invent the wheel? ImageMagick's convert
program will convert

GRAY Raw gray bytes.
GIF CompuServe graphics interchange format; 8-bit color.
GIF87 CompuServe graphics interchange format; 8-bit color (version 87a).
JPEG Joint Photographic Experts Group JFIF format; compressed 24-bit color.

and many others. And it is available for Windows NT (runs on 95). (You don't need Xwindows to run convert,
so do not be put off by the docs.)

If it really is a million, I would not go near S-PLUS unless you are
very very confident of no memory build up. And at 2 sec/image it will
take a month. And even small examples (32 x 32, rather small for JPEG)
take a gigabyte of input. And does your Windows 9x machine stay up that long?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news