Subject: Re: HDF raster -> gif?

From: Doug Ilg <[email-masked]>
Date: Thu, 08 Feb 1996 09:57:06 -0500

Hi Mike,

Mike Zulauf wrote:

>      I have some questions regarding raster images in HDF.  Basically,
> I need to translate them into gifs somehow.  Does anyone know of a
> utility (unix - Sun preferably) which could do this?

You might try Reformat/XReformat from NCSA.  I understand it's recently been
updated, so I'm sure there's support for GIF (I think it was there before,
anyway).  You can get it from ftp://ftp.ncsa.uiuc.edu/ (same place you got
HDF).

> Can I use the following call to write a jpeg image to an HDF file?
> 
>  d8aimg(filename, image, width, height, compress)
> 
> If I can, what do I use for 'compress', and how can I specify the
> quality of the image?  I would want to use a quality of 100.  If this
> isn't the proper way to do this, then what is?

For your situation, you shouldn't need to, but to use JPEG in HDF, the most
reasonable [and maybe the only] way is to call DFR8setcompress() before you
make the call to DFR8addimage().  (Sorry, I don't remember all the FORTRAN
names for these routines.)  'Setcompress will let you tune the JPEG algorithm
in the normal way.  You can find it on page 49 of the Feb 1994 edition of the
HDF Version 3.3 Reference Manual.  This page also gives the complete list of
symbolic constants for use as the `compress' argument.

Feel free to send email, if you have more questions.

====================================================================
Doug Ilg                                      Hughes STX Corporation
EOSDIS Standard Data Formats          7701 Greenbelt Road, Suite 400
[email-masked]                     Greenbelt, MD  20770  USA
Voice: (301) 441-4089                            FAX: (301) 441-1853
================= I do not speak for HSTX or NASA ==================

---

From: Greg Bryan <[email-masked]>
Date: 8 Feb 1996 19:08:38 GMT

>utility (unix - Sun preferably) which could do this?

The San Diego Supercomputing Center's Image Tools should be able to
do this directly.  Get imconv from ftp://ftp.sdsc.edu/pub/sdsc/graphics/imtools
(I know they have a sun version) and do something like:

imconv image.hdf image.gif

(A few caveats: I'm not sure if they support both 8 and 24 bit HDF rasters
nor do I know what their current HDF version is, whether they support more
than one image per file, etc.  But it's worth a shot and imconv supports
many different image types so its handy to have around.)

Greg Bryan
[email-masked]