Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


JPEG - Color problems

This topic is 6086 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! There was no answer in the "visual arts" forum - so i will try it at "Game programming": I am using directx7. I load my .bmp-graphics - all works well. But if i load the same graphics (using NViewLib.dll) as .jpg, it seems that black (my colorkey) is not really black. For example around yellow colors there are a lot of pixels that appears not transparent. I use Adobe photoshop to save the .bmp as .jpg (highest quality). Any ideas? It would be nice to use .jpg to get a downloadable game. Thanks McMc

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
In the structure DDCOLORKEY

typedef struct _DDCOLORKEY{
DWORD dwColorSpaceLowValue;
DWORD dwColorSpaceHighValue;

Did you set both high and low value to black? If so, be careful as jpeg compression doesn''t store images in a similar fashion to gif/bmp. Black areas may not be wholly black and may be approximated over a wide range of values. Give a higher range to the high and low values and see if that makes a difference.


Share this post

Link to post
Share on other sites
I am pretty sure the problem is solved if you don''t use a single color for transparency, but a color-range.

If you use BMPs, the right color for each Pixel is stored, but if you use JPGs compression, it will only store "A color close to the one you wanted". So a JPG black isn''t the same black at all places.
Your eye can''t differ a RGB 0-0-0 black from a 0-1-1 black, but for transperency it does differ.

Hope this helps.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!