Re: How to make higher resolution GIF or JPEG image? [message #38059 is a reply to message #38021] |
Fri, 13 February 2004 16:26   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Larry, just bringing it back to the list...
"Lawrence Bleau" wrote in message...
>>> 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.
>> You can make the image big, load it into Photoshop (or similar program),
>> convert it to RGB, then resize it, then convert it back to indexed and
>> save as gif. This will give you the buttery look you desire. The key
>> is changing it to RGB format since scaling in indexed mode won't get
>> rid of the aliasing. Heck, you could probably do something like that
>> in IDL.
> The photoshop approach won't work, since I want to be able to do these
> operations in non-interactive mode.
>
> Is there a way to make the RGB in IDL?
Since we're working with the Z buffer (aren't we?) or at least an 8 bit
device, we need to convert to RGB because TVRD(/TRUE) won't work.
This probably won't win any awards but...
image = TVRD()
TVLCT, R, G, B, /GET
s = SIZE(image, /DIMENSIONS)
rImage = BYTARR(s)
gImage = BYTARR(s)
bImage = BYTARR(s)
for n=0, 255 do begin
idx = WHERE(image eq n, count)
if (count gt 0) then begin
rImage[idx] = R[n]
gImage[idx] = G[n]
bImage[idx] = B[n]
endif
endfor
rImage = REBIN(rImage, s/2)
gImage = REBIN(gImage, s/2)
bImage = REBIN(bImage, s/2)
newImage = COLOR_QUAN(rImage, gImage, bImage, R, G, B, $
CUBE=6)
This works o.k. but you'll notice that lines and text will be thinner and
the colors won't be as saturated. Just thicken up lines and text until you
get desirable results. Also, play around with the downsampling (CONGRID vs
REBIN) and the COLOR_QUAN keywords. I don't know what you'll get.
Hopefully this will help.
-Rick
|
|
|