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

  • SEARCH
  • Home
  • 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 6020189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:31:54+00:00 2026-05-23T03:31:54+00:00

I’m writing a C++ program which reads a texture image file then convert and

  • 0

I’m writing a C++ program which reads a texture image file then convert and save as .png.

When I met the ARGB half precision float pixel format.

I tried for each pixel ARGB channel

  1. read 16 bits
  2. convert to 32bit c primitive float
  3. multiply 255 or 1 (i’m not sure what’s the valid range of the half-float value)
  4. cast to a BYTE value

but I couldn’t get the visible image. maybe the convert method was incorrect.

What’s the formula to convert the half precision float to 8bit color intensity value?

  • 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-23T03:31:55+00:00Added an answer on May 23, 2026 at 3:31 am

    The details of reading half floats are explained, including code, in a blog post here:

    http://fpmurphy.blogspot.com/2008/12/half-precision-floating-point-format_14.html

    After reading in your floats you will have to perform a tone mapping operation to get you values in the 0..255 ranged allowed for PNGs. This operations is called “tone mapping”, and you have various options to perform it. A very simple thing to do would be to find the maximum value in the image, M and scale all pixels intensities by 255 / M to get into the desired range. There are algorithms which are quite a bit more involved, though.

    Depending on the source of your images you might also apply gamma correction before writing out the images. Because you have to work with float values anyway I’d suggest to do all calculations using floats and do the float->byte conversion as the last step to avoid image quality problems like banding.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
i want to parse a xhtml file and display in UITableView. what is the
I am writing an app with both english and french support. The app requests

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.