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 
Return to the default flat view Create a new topic Submit Reply
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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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: Wed Dec 03 06:53:09 PST 2025

Total time taken to generate the page: 1.44241 seconds