473,372 Members | 839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 1948

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Joe | last post by:
When you run "python -i scriptname.py" after the script completes you left at the interactive command prompt. Is there a way to have this occur from a running program? In other words can I...
by: Kim Scarborough | last post by:
Say I wanted to put a couple lines of asterisks between paragraphs, and have it stretch the spaces so that it spanned 100% of the text-width, like this: * * * * * ...
by: Cezar | last post by:
Hi. I have below little code. This generate a bar with small rectangle on left and right side. If mouse is not over bar, then rectangles are gray. If mouse is over bar then rectangles are red....
by: yawnmoth | last post by:
in firefox, long strings without spaces cause a horozontal scrollbar to appear at the bottom of any given textarea. for example, if your textarea supports 50 characters, and 100 consecutive...
by: Raed Sawalha | last post by:
I read in MSDN an examples for Image Stretching but something I can not understand is this line e.Graphics.DrawImage(newImage, destRect1, x, y, width, height, units); what is e in all example they...
by: ACaunter | last post by:
Hi there, I was wondering how i could have a slider bar or something on my ASP.Net page to control the image quality.. like change it's sharpness, brightness, and contrast?? is that possible??...
by: Arthur Dent | last post by:
Hello all... i have a really frsutrating problem here... This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK. I have a top-level table with a width of 760px, so it should be...
by: nigel | last post by:
somebody recently showed me how to create a new line using \n which was great.The thing is when i am creating the programme the text i wish to add is quite long.and it ends up stretching the width...
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m stretching my form and i want if i stretch its position after stretching must be in middle of screen or i want to stretch centerly. Thanx >> ALI <<
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.