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 4622040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:47:14+00:00 2026-05-22T02:47:14+00:00

i have a pixel array containing the values from 0 to 255 … i

  • 0

i have a pixel array containing the values from 0 to 255 …
i have passed it to my c++ function …
this pixel array i want to save it to jpeg image file…

how to do it with correct encoding ??

i have converted the array to binary string
and saved it into the file in the below code but it just saves an empty image of 4 byte size …

    FILE *file = fopen("/media/internal/wallpapers/04.jpeg", "w+");
    fwrite(binaryStr , 1 , sizeof(binaryStr) ,file );    

    fclose(file);

thnks

  • 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-05-22T02:47:15+00:00Added an answer on May 22, 2026 at 2:47 am

    From your description it looks like you have YUV-data that you need to convert to jpeg. Correct? Imagemagick is a very powerful tool that can handle this.

    From wikipedias entry on YUV:
    Y’ values are conventionally shifted and scaled to the range [16, 235] rather than using the full range of [0, 255]. This confusing practice derives from the MPEG standards and explains why 16 is added to Y’ and why the Y’ coefficients in the basic transform sum to 220 instead of 255. U and V values, which may be positive or negative, are summed with 128 to make them always positive

    I.e. 0-255 is not a valid range for YUV-data

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

Sidebar

Related Questions

I have an 8bit Image (stored in an Array) containing black(0) and white(255) pixels.
I have an array that contains the RGB colour values for each pixel in
I have an object of the type System.Drawing.Image and want to make every pixel
Say I want to create an array of pixel values to pass into the
I have array with colors as its objects. I want to create an image
I have this matrix A, representing similarities of pixel intensities of an image. For
I'm currently turning an array of pixel values (originally created with a java.awt.image.PixelGrabber object)
I'm trying to get the pixel information from an image and have got to
I have an array of ushort pixel data (16-bit grayscale values), and I am
I have an array of ushort pixel data that I need to save as

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.