comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » [Q] writing color JPEGS
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
[Q] writing color JPEGS [message #7291] Tue, 22 October 1996 00:00
savoie is currently offline  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
* - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
[Message index]
 
Read Message
Previous Topic: 2D FFt
Next Topic: Workaround for "Program unit has too many local variables"?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:20:46 PDT 2025

Total time taken to generate the page: 1.04175 seconds