[Q] writing color JPEGS [message #7291] |
Tue, 22 October 1996 00:00 |
savoie
Messages: 68 Registered: September 1996
|
Member |
|
|
Hi, I'm having a slight problem writing Color JPEGS in IDL. I looked at the
FAQ, but it doesn't have any direct examples.
I'm running IDL. Version 4.0.1 (sunos sparc).
Here's a sample program that I ran to generate gif and jpeg output. The
problem is that the only reasonable jpeg I can generate is when I don't use
the TRUE keyword, but that only seems to generate grey images.
Does anyone out there know what I'm doing wrong? Can you send me an example
that works?
;---------8<-------------------8<-------------------8<-------------------8 <--
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
PRO dumper
;;; creates a pretty mess for jpegs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
;; load rainbow
loadct, 13
tvlct, r, g, b, /get
tvlct, r, g, b
;; set up a picture, window, byte scale the data and display in window
data = dist(400,400)
window, /free, xs=400, ys=400
data = bytscl(data, top=!d.n_colors)
tv, data
;; do different types of read from the window
jpg0 = tvrd()
jpg1 = tvrd(true=1)
jpg2 = tvrd(true=2)
jpg3 = tvrd(true=3)
imggif = tvrd()
;; write the functions.
write_jpeg, 'test0.jpg', jpg0, quality=100
write_jpeg, 'test1.jpg', jpg1, quality=100, TRUE=1
write_jpeg, 'test2.jpg', jpg2, quality=100, TRUE=2
write_jpeg, 'test3.jpg', jpg3, quality=100, TRUE=3
write_gif , 'test.gif', imggif, r, g, b
END
;---------8<-------------------8<-------------------8<-------------------8 <--
The outputs of this program can be viewed here:
<http://rintintin.colorado.edu/~savoie/>
Thanks in Advance,
--
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Matthew H. Savoie Systems Technology Association
Systems Analyst Supporting NOAA Profilier Network
ph. 303.497.6642 Demonstration Division/FSL/ERL
mailto: savoie@fsl.noaa.gov http://www-dd.fsl.noaa.gov/online.html
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
|
|
|