Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:10:43+00:00 2026-06-15T13:10:43+00:00

I have a problem when converting YUV file to RGB file. When I am

  • 0

I have a problem when converting YUV file to RGB file. When I am done I can’t open .rgb file with GIMP or other viewers, but I succeed to open downloaded .rgb files. Please tell me what the structure of RGB file? (Does it contain a header?) Is it:
1) all R values, then all G values, then all B values?
2) loop (one R one G one B) * pixels count?

void convert_YUV_to_RGB (unsigned char  Y1, unsigned char  Y2, unsigned char  Y3, unsigned char  Y4, unsigned char  U, unsigned char  V) {

/*
//V1 for conversion YUV 420 -> RGB
//1.164*(Y - 16) + 1.596*(V - 128);
//1.164*(Y - 16) - 0.813*(V - 128) - 0.391*(U - 128);
//1.164*(Y - 16) + 2.018*(U - 128);
*/
rgb[rgb_counter++] = Y1 + 1.403*V;
rgb[rgb_counter++] = Y1 + -0.344 * U + -0.714 * V;      
rgb[rgb_counter++] = Y1 + 1.770 * U ;   

rgb[rgb_counter++] = Y2 + 1.403*V;
rgb[rgb_counter++] = Y2 + -0.344 * U + -0.714 * V;      
rgb[rgb_counter++] = Y2 + 1.770 * U ;   

rgb[rgb_counter++] = Y3 + 1.403*V;
rgb[rgb_counter++] = Y3 + -0.344 * U + -0.714 * V;      
rgb[rgb_counter++] = Y3 + 1.770 * U ;   

rgb[rgb_counter++] = Y4  + 1.403*V;
rgb[rgb_counter++] = Y4 + -0.344 * U + -0.714 * V;      
rgb[rgb_counter++] = Y4 + 1.770 * U ;   }


for each (int i in rgb) 
    {
        fputc(i, pRGBFile);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:10:43+00:00Added an answer on June 15, 2026 at 1:10 pm

    You could try to write the data as a BMP file. IIRC, the RGBs value are interleaved; i.e. R1G1B1R2G2B2…RnGnBn

    When you say ‘it doesn’t work’ do you mean the program fails to open the file or the colours look wrong?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no problem converting normal double values, but I can't convert numeric_limits<double>::max( )
Hey I'm running into a similar problem as: Converting RGB to YUV, + ffmpeg
I have a problem converting a File Blob comming from a Webservice to an
i have a problem with reading from a file, and converting content to double.
I have a problem with converting a color from HSL to RGB. I've written
I am new to vc++. I have a problem in converting file path to
I have a problem with converting a text file from ANSI to UTF8 in
I have a problem converting a string binary to a decimal I was using
I have a problem while converting a string whose value is dd.mm.yyyy to DateTime
I have a weird problem in converting a string to double in .NET 3.5.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.