The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: dougiem on December 27, 2004, 09:22:14 PM

Title: Adjusting bitmap contrast
Post by: dougiem on December 27, 2004, 09:22:14 PM
I am trying to adjust the contrast of a bitmap - I have access to the pixel buffer, but I am not sure if there is an algorithm or if I have to slog it out.
Thanks,  DougieM.
Title: Re: Adjusting bitmap contrast
Post by: donkey on December 28, 2004, 05:02:41 AM
I have thought quite a bit about that as well but never got around to writing a useable algorithm. Essentially contrast involves splitting the image at a given luma value and increasing all the pixels above that value and decreasing all the values below. I did a few tests but was not satisfied with the results, it sounded like a simple thing to write on the surface but the actual implementation was disappointing enough not to be included in my graphics library. I guess I will eventually have to take another look at it and try some sliding (perhaps logrithmic) scales for the amount of increase/decrease based on how far the pixels luma is from the reference.
Title: Re: Adjusting bitmap contrast
Post by: dougiem on December 29, 2004, 11:16:14 PM
Thanks Donkey, I was a bit unsure if I would be re-inventing the wheel if I went ahead whith my understanding of what would be needed - I'll give it a bash, thanks.
dougiem.
Title: Re: Adjusting bitmap contrast
Post by: petezl on December 31, 2004, 12:40:53 PM
Donkey,
You got me wondering if it would be not too difficult to write a graphics program that could accept standard plug-ins.
This would open a completely new sphere to a basic graphics application...

Peter.
Title: Re: Adjusting bitmap contrast
Post by: donkey on December 31, 2004, 01:06:57 PM
Hi petzl

The standard pretty much for plugins is Adobe's Photoshop, other apps like Paintshop etc... all accept them. Though I prefer a message based interface like I used in TBPaint, I am looking into the Adobe interface for plugins to see if it might be a good idea to allow them in TBPaint v2.
Title: Re: Adjusting bitmap contrast
Post by: pbrennick on December 31, 2004, 02:41:45 PM
Donkey,
I am glad to hear that you intend to continue developing TBPaint.  It is a very useful part of my toolbox.

Paul
Title: Re: Adjusting bitmap contrast
Post by: donkey on December 31, 2004, 02:45:22 PM
Hi pbrennick,

That is good to hear. I am continuing the development however it is slow going as I am trying to replace all the GDI drawing calls and develop my own faster ones. That is the driving force behind the lib project for GoAsm, especially the graphics library. The new version will hopefully be out for bug tests in mid-February and will feature a much more powerful plugin interface as well as some really cool filters. The basic engine is complete, I have only to rewrite the user interface and sew it all together. Then comes bug tests...