Control Image Contrast, Brightness, and Sharpness

G

Guest

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??
thanks
 
K

Kevin Spencer

Sure. You'd just have to do a PostBack and reprocess the image with each
change of the controls.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
G

Guest

Hey Kevin,
how could i change the controls, like brightness, contrast, and sharpness of
an image... I have an image and now i want to manipulate that image by making
it brighter or sharper... do you have any code that could do this sort of
thing to an image??? "reprocess the image with each change of the controls"

thanks so much..
 
K

Kevin Spencer

how could i change the controls, like brightness, contrast, and sharpness
of
an image...

Well, now, that is a good question! I have written some of my own classes
for editing images programmatically, and some of these things require some
pretty low-level programming to do. Brightness, Contrast, Sharpness, Blur,
etc. are all what is referred to as "filters." A filter is an algorithm
that, when applied to an image, affects the entire image. Depending upon the
filter, it may require scanning each pixel and all of the surrounding
pixels, and performing some math upon them to reset their values.

I can think of 2 different approaches for you in regards to this: One would
be to Google a ready-made image editor class that can perform these types of
operations for you. I believe there are some commercially-available products
out there for .Net. The other would be to Google the necessary algorithms
(that is what I originally did long ago), and write your own classes.

Displaying the images would be a matter of creating an ASPX page that
functions as an "image" in an image tag on the client. When Requested, the
page would create an image, modify it, set the Response.ContentType to the
appropriate MIME type for that image, and save the image to the
Response.OutputStream. One nice thing about using an ASPX page is that you
can pass parameters to it via QueryString, so that the editing could be done
by modifying the QueryString in the image URL. Of course, you caould also
use some form of form controls on the client, etc.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top