Mr.Madguy, I tried your code and it worked SUPERBLY! This is what I ALWAYS wanted! I praise you because this is a real breakthrough. I do have to convert it to raw image and I'm a little rusty but I think that I can do it.
It's obvious that I need to speed the code up and make it more efficient. I have also found that a bitmap is faster and more reliable than working with a TImage.
Your code will be the default contrast method.
I can't say too much how great this is because not only does it do traditional contrast changes as good as or better than HiJaak Draw (which is saying alot), it also enables all the transparency and color controls to work much, much better and faster than before. I've tested it out and it's really amazing how much it helps.
This means that the current download version of this program will need to be updated. With your permission I will mention Lazarus and your handle name in the program update logs and instructions (a long readme file) because the credit is yours, not mine.
wp, I assume that what you suggested is shown in Mr.Madguy's code.
Thank you again. This is incredible.