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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:10:13+00:00 2026-05-14T06:10:13+00:00

im trying to create an image filter in OpenGL CE. currently I am trying

  • 0

im trying to create an image filter in OpenGL CE. currently I am trying to create a series of 4×4 matrices and multiply them together. then use glColorMask and glColor4f to adjust the image accordingly. I’ve been able to integrate hue rotation, saturation, and brightness. but i am having trouble adding contrast. thus far google hasn’t been to helpful. I’ve found a few matrices but they don’t seem to work. do you guys have any ideas?

  • 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-14T06:10:13+00:00Added an answer on May 14, 2026 at 6:10 am

    I have to say, I haven’t heard of using a 4×4 matrix to do brightness or contrast. I think of these operations as being done on the histogram of the image, rather than on a local per-pixel basis.

    Say, for instance, that your image has values from 0 to 200, and you want to make it brighter. You can then add values to the image, and what is shown on the screen will be brighter. If you want to enhance the contrast on that image, you would do a multiplication like:

    (image_value - original_min)/(original_max - original_min) * (new_max - new_min) + new_min
    

    if you want your new min to be 0 and your new max to be 255, then that equation would stretch the contrast accordingly. The original_min and original_max do not have to be the actual min and max of the entire image, the could be the min and max of a subsection of the image, if you want to enhance a particular area and don’t mind clipping values above or below your new_min/new_max.

    I suppose if you already know your range and so forth, you could incorporate that formula into a 4×4 matrix to achieve your goal, but only after you’ve done a pass to find the min and max of the original image.

    I would also make sure to uncouple the display of your image from your image data; the above operations are destructive, in that you’ll lose information, so you want to keep the original and display a copy.

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

Sidebar

Related Questions

I'm trying to create an image with GD then use that image with a
I'm trying to create an image with the php libgd library and use the
I'm trying to create an image using matplotlib.pyplot.imshow() . However, when I run the
Trying to create a background-image slideshow and am getting this error... This is the
I am trying to create a sortable image matrix, 5x5 using scriptaculous javascript library
I'm trying to create a fast image generator that does lots of 2d transformations
I am trying to dynamically create a Bitmap Image using byte array using following
I am trying to create a table with an image as a background. To
I'm trying to create a WPF application where I can drag an image around.
I am trying to create a wpf control that will display a map image

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.