Re: How to make higher resolution GIF or JPEG image? [message #38060 is a reply to message #38059] |
Fri, 13 February 2004 14:40   |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
> I want to generate a GIF file with a raster-like plot in it. I know
> how to do this using the Z-buffer as a device (SET_PLOT,'Z'). All my
> experience with GIF plots on other systems, though, show they display
> with slightly jagged lines, as though made on a low-res plot (which
> GIF is, I suppose). I have seen, however, GIF plots made by other
> packages that have a great look: smooth curves and letters, no
> jaggies.
The jaggedness you see is a result of aliasing. Anti-aliasing is the
process that makes lines and curves appear nice and smooth. There's
plenty on the internet about anti-aliasing, so I won't delve into that
topic here. Basically, a plot will look jagged because each individual
pixel is either on or off; in this case either white or black.
Something that is anti-aliased will have shades of gray along with the
white and black. The grays trick the eyes so that they see a smooth
continuous line. In short, the plot is not anti-aliased; there is
nothing wrong with the GIF format itself.
> I know how to vary the size of the output GIF file: the SET_RESOLUTION
> keyword to the DEVICE command. The problem is that this keyword only
> changes the *size* of the resultant GIF file, not its resolution. If
> I use this keyword, all I get is a large GIF file with jaggies. When
> viewed on a browser, that gives me a larger image. I want the image to
> stay the size that can be displayed on a normal browser window, just
> to have a higher resolution.
Resolution is not the problem. See above paragraph.
> If there's none, I can create an alternate format, such as PostScript,
> that has the high resolution plots. I'd then have to convert it to
> GIF (simply because very few browsers, if any, interpret PS).
It's not that PS is high resolution -- it's because PS uses vector
graphics rather than raster graphics. This allows PS viewers to redraw
the image when the resolution changes.
> Does anyone know of a way to convert PS to GIF? I read about
> Ghostscript and Ghostview, but the ftp site says they removed the GIF
> generation capabilities from the package due to licensing problems.
> Since we're going to be displaying these gif's on the web, that's
> probably not a way for us to go. Any other ideas?
You can use PNG instead of GIF. PNG is basically a free replacement for
GIF. It's been supported in IDL for a while and nearly everyone who I
work with who use to use GIFs now use PNGs. I wouldn't recommend JPEG
or any other lossy format. And PNGs can be seen without problem in web
browsers.
> In particular, take a look at the characters used to label the axes.
> Even at higher resolution they look bad. And yes, I know jaggies are
> usually an artifact of the monitor. Only thing is, I've seen a GIF
> display on a monitor that *didn't* have jaggies, so I know it's
> possible.
Fonts created in IDL direct graphics do not look good at all, and there
are many here who have voiced similar complaints. One thing you can do
is use hardware fonts or use object graphics. Another thing you can do
is the "make 'em big trick" as described here:
http://www.dfanning.com/graphics_tips/zfonts.html
HTH,
Mike
|
|
|