470,634 Members | 2,073 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,634 developers. It's quick & easy.

Interactive contrast stretching

Before I ask for help, let me give you my situation, including what I
HAVE been able to do.

I am trying to show an image (large, say the whole screen), and allow
for instantaneous visual results with regards to a lookup table
change. In essence, I am going for an interactive contrast stretch. I
have been able to do this, but only for one band of a 3 band image.
Thus, I have been able to create a byte array of pixels, and by
changing the IndexColorModel for the image, I can update the screen to
display "different" values instantaneously. Like I said, I have only
been able to do this for 8 bit data.

Knowing I can only do this for 8 bit arrays, I created 3 byte arrays
of pixels. Each created image would then have its own IndexColorModel.
However, I have been unsuccessful at taking these 3 created images,
and on-the-fly (with little or no processing) creating one image that
just references its red values from one image, its green values from
theh second image, and its blue values from the third image. I have
resorted to trying to use alpha values and drawing the 3 images one on
top of another. This is not ideal, and does not produce the intended

What I want to do is take a 3 band image (representing RGB) or
essentially an int array, and have an IndexColorModel for each band,
but have the actual image setup to feel like it is based off of 3 byte
arrays. Thus, it looks up the red values in one model, the green in
another, and the blue in another... and also looks up the
corresponding pixels from its 3 RGB components. So, 3 look up tables
consisting of 256 entries each... and only one image...

I feel like I have searched high and far, but have come up with
nothing that helps me with my intentions. The DirectColorModel only
allows me to set color masks... but doesnt give me the luxury of
defining what pixels map to.

Anyway, any help would be greatly appreciated.
Jul 17 '05 #1
0 1804

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Joe | last post: by
22 posts views Thread by Kim Scarborough | last post: by
reply views Thread by Cezar | last post: by
3 posts views Thread by yawnmoth | last post: by
3 posts views Thread by Raed Sawalha | last post: by
4 posts views Thread by Arthur Dent | last post: by
1 post views Thread by nigel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.