Jump to content
  • Advertisement
Sign in to follow this  

Porting hq4x to 24 bit color

This topic is 3009 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

I've been trying to port hq4x code to work with 24 bit color bitmaps. The original code converts the bitmap to 16 bit before applying the hq4x algorithm. Here is the original code and its result And my attempt at making it 24 bit with this result. Entire source code here What I don't get is the original version converts the 16 bit color to 32 bit before it starts writing to the destination (lines 313-314). As far as I can tell it only uses the 16 bit color to convert from RGB to YUV (actually its YCbCr). So I replaced that the conversion to go from 24 bit RGB to YUV (per YUV - RGB Color Format Conversion). Thinking the fault may have been the chance of RGBtoYUV code. I tried converting the 24 bit to 16 bit color on the fly and using the original RGB to YUV code. Still produced the same result. So I'm thinking the problem is that the Interp functions don't work across the whole range of 24 bit color values. Whereas in the original code the conversion to 16 bit then to 32 bit reduces the possible values and hence it works. But if that is the case I don't understand why or how I could fix them to work with all 24 bit color values.

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!