News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Adjusting bitmap contrast

Started by dougiem, December 27, 2004, 09:22:14 PM

Previous topic - Next topic

dougiem

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.

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dougiem

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.

petezl

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.
Cats and women do as they please
Dogs and men should realise it.

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

pbrennick

Donkey,
I am glad to hear that you intend to continue developing TBPaint.  It is a very useful part of my toolbox.

Paul

donkey

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...
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable