Skip to main content
gamedev.net
🔒 Locked

window/level (brightness/contrast?)

Started by mark-w Sep 15, 2005 at 8:35 AM 0 replies 1k views
Original Post
mark-w
mark-w
Hi all, Has anyone here had any experience with 'window and leveling'? It's basically the ability to specify a range of scalar values to be displayed in an image. (I think this may be synonymous with brightness/contrast). So if your image has grey scale values of 0 to 3000, you can specify your 'window' to be 200, and 'level' to be 1000. Therefore, the scalar values between 900 and 1100 would be mapped to the minimum and maximum values for your display. Any values under recevie black, any values over receive white. I've implemented this so the user of my app can change the window/level in real time by shifting the mouse around, and it works well for images up to about 400 x 400 pixels with 3 color channels. Once I get to 512x512 it starts getting a little choppy. Just wondering if anyone has any experience with this, and if there is some way I can fake this effect, for instance overlaying a transparent quad over my image and just changing its transparency to *look* like I'm doing a per pixel multiplication etc etc. I'm doing this all with just windows bitmaps, no opengl or anything. Thanks!
Nik02
Nik02
The operation is commonly called "tone mapping", a process of transforming a color from one space to another. The most efficient way to implement it is to use pixel/fragment shaders in either Direct3D or OpenGL, and let the graphics hardware do the calculation. This is very simple operation for modern cards, and can be an order of magnitude faster on hardware rather than software.

Some implementations of tone mapping use parameters "bias", "gamma" and "range"; bias controls the base black level, gamma defines the exponential curve with which to weigh the brightness values for midpoint color control, and range defines what you call "window", effectively marking the white point based on bias + range.
Niko Suni

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.