Jump to content
  • Advertisement
Sign in to follow this  
Thaligar

Image Compression [SOLVED]

This topic is 3161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, is there a way to hold an image compressed in memory and on the fly, during display, to uncompress it? Thanks in advance, tgar [Edited by - Thaligar on October 29, 2009 3:15:09 AM]

Share this post


Link to post
Share on other sites
Advertisement
In general, "yes", but without more information it's impossible to say for sure - it depends on how you're intending on displaying the image.

Share this post


Link to post
Share on other sites
Most graphics hardware supports special block-compressed texture formats, blocks of which are unpacked just before sampling; thus, they stay compressed in the video memory.

The legacy compressed formats (DXT1-DXT5) do cause a reduction in image quality, but you gain performance and memory benefits.

D3D11 hardware introduces a HDR-compatible compressed format and an adaptive LDR format. Both of these will give better (but not perfect) quality.

SM4 (D3D10) and up make it practical to do your own decompression on pixel shaders, if the existing formats do not suit your needs.

Share this post


Link to post
Share on other sites
Uh... sorry for the late reply.

Thanks for the answers.

DXT I know, but the problem is I want do this in MFC. But for my OpenGL projects the DXT will be the best.

I already found a source snippet which loads a jpeg directly into memory and decompresses it during redraw through a IStream object.

Is there a way to load the jpeg as image but still hold it compressed in memory?

Thanks again,
greets
tgar

Share this post


Link to post
Share on other sites
Quote:
Original post by Thaligar
Is there a way to load the jpeg as image but still hold it compressed in memory?
No, jpeg is not a supported compressed texture format on any current card.



There are many reasons that it is not supported, and many more reasons that it will probably never be supported.

* The basic compression algorithm makes it difficult to do a reverse lookup of a pixel color. This is the biggest killer for video cards, since that is basically all they do.

* There are many standard formats (Wikipedia lists 11 different international standards)

* There are many more non-standard formats.

* Decompression is not 100% perfect -- the math involved and the international standards allow a 1-bit difference for each pixel component.

There are many other graphics formats that are nicely suited to graphics cards -- which also happen to be the formats the cards already support.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!