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

Home » Public Forums » archive » Re: Image file creation file size too large
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Image file creation file size too large [message #62662] Sat, 27 September 2008 21:33
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> Thanks again Dr. Fanning! You are THE IDL GOD!!

This is what my wife was telling me, or something like
it, when she ordered me to get the damn garbage out, PLEASE!

But, I appreciate the acknowledgement. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Image file creation file size too large [message #62663 is a reply to message #62662] Sat, 27 September 2008 21:04 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
yup I got it... it was the way I was closing the windows. I was
closing window 0 right away, so I just close it after I do all the
image creation code. Not really sure why it would do that but it
works! Thanks again Dr. Fanning! You are THE IDL GOD!! I'm going to
acknowledge you for all your help in my thesis paper.

Thanks,

Frank
Re: Image file creation file size too large [message #62664 is a reply to message #62663] Sat, 27 September 2008 21:02 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> I'm using the exact code you posted so its from tvrd. I'llplay around
> with it some more to see if I can fix it. Thank you very much for all
> your help!

Yeah, I don't know. Too weird. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Image file creation file size too large [message #62665 is a reply to message #62664] Sat, 27 September 2008 19:52 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
I'm using the exact code you posted so its from tvrd. I'llplay around
with it some more to see if I can fix it. Thank you very much for all
your help!
Re: Image file creation file size too large [message #62666 is a reply to message #62665] Sat, 27 September 2008 19:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> Thank you very much Dr. Fanning! This seems to get the results I need.
> However, I seem to be getting a pop up window when using the tvrd
> without anything
> on it. Is there anyway to block this from happening?

Say what!? From TVRD or from TVREAD? Is the window the
size of a graphics window?

Don't have the foggiest idea what is going on. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Image file creation file size too large [message #62667 is a reply to message #62666] Sat, 27 September 2008 18:51 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
Thank you very much Dr. Fanning! This seems to get the results I need.
However, I seem to be getting a pop up window when using the tvrd
without anything
on it. Is there anyway to block this from happening?

Thanks,

Frank
Re: Image file creation file size too large [message #62669 is a reply to message #62667] Sat, 27 September 2008 15:07 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> image24bit = TVRD(TRUE=1)
> image8bit = Color_Quan(image24bit, 3, r, g, b)
> Write_PNG, filename, image8bit, r, g, b

Whoops, this should be:

image24bit = TVRD(TRUE=3)
image8bit = Color_Quan(image24bit, 3, r, g, b)
Write_PNG, filename, image8bit, r, g, b

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Image file creation file size too large [message #62670 is a reply to message #62669] Sat, 27 September 2008 15:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> I'm trying to create a bmp image file off of a display window but the
> file size once created is about 3.0mb.
> I've created images using the z-buffer and a 1024x1024 image was about
> 1.0mb but this one is also a 1024x1024 so I'm not sure what is going
> on. Any help is greatly appreciated

The way you are setting your Z-graphics buffer up,
it is an 8-bit device. Your display is undoubtedly
a 24-bit graphic device. TVREAD is smart enough to
figure out what sort of device you are on. In the
8-bit case, it creates a color PNG image by writing
the 8-bit screen capture and the RGB vectors of the
current color table. In the 24-bit case, it just creates
a 24-bit image. (So, I think the result is a [1024,1024,3]
array, not a [1024,1024]. This accounts for it being
three times the size of the image you created in the
8-bit case.)

TVREAD used to always write a smaller image, but of
course that compromised colors in real 24-bit space,
since to do that you have to restrict everything to
256 colors. It seemed the wrong thing to do. So, when
it can preserve 24-bit colors, it now always does so.

If you want to read from your display, and make an
8-bit PNG image, you can be my guest. Use COLOR_QUAN
to reduce the 24-bit screen capture to an 8-bit image
and the three color vectors that describe the reduced
number of colors in the image.

image24bit = TVRD(TRUE=1)
image8bit = Color_Quan(image24bit, 3, r, g, b)
Write_PNG, filename, image8bit, r, g, b

That should result in an image that is about 1MByte.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Image file creation file size too large
Next Topic: Re: rebin but ignore zero

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

Current Time: Fri Oct 10 10:22:01 PDT 2025

Total time taken to generate the page: 0.95914 seconds