Image conversion


Hi,
As you know in the adobe photoshop there are many filters.
My question is that, Can we make these types of filter in the visual studio C# .Net program?

Problem 1: how can i convert the color picture into the black & white color or the other color scheme?

Problem 2:let suppose there is a picture (obviously combination of diffrent color),how can i show the desired color and hide the remaining color ?
For example:- there is a picture of a red flower with the green leaves
then if user select the red color from the menu and click the filter button then only red flower should show.

Problem 3:I do like a program ,which has the 'color sense' ,means that if user open the red flower's picture and click on the leave then word "green" display.

i am waiting for your kindly response.
Thanks

Comments

  • Yes, you can perform all these things using .NET and C#. There is a whole GDI+ library encompassed in the namesapces below:

    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Drawing.Imaging;

    You have brushes, pens, color objects, fonts, paths, Bitmap objects, etc ...

    w/ a Bitmap object, you can load images or create imges from scratch. You use the Graphics object to paint on a bitmap. The bitmap has GetPixel and SetPixel functions (which are slow), however you can actually go as far as getting a memory pointer to the pixel data in a bitmap.

    Once you you have the pixel data in a byte array, you can loop through and use algorithms for greyscaling (which would be taking the average of the red, green, and blue components and using that average to replace the red, green, and blue components.)

    Colors have an alpha channel, so you can make images translucent, opaque, or invisible. To support transparency, you can use a SetColorKey function, then when you use a DrawImage function, it will draw all pixls accept for pixels that match the color key.

    Your third task should be easy. You should be able to call the GetPixel function of a bitmap to determine the color.

    :
    : Hi,
    : As you know in the adobe photoshop there are many filters.
    : My question is that, Can we make these types of filter in the visual studio C# .Net program?
    :
    : Problem 1: how can i convert the color picture into the black & white color or the other color scheme?
    :
    : Problem 2:let suppose there is a picture (obviously combination of diffrent color),how can i show the desired color and hide the remaining color ?
    : For example:- there is a picture of a red flower with the green leaves
    : then if user select the red color from the menu and click the filter button then only red flower should show.
    :
    : Problem 3:I do like a program ,which has the 'color sense' ,means that if user open the red flower's picture and click on the leave then word "green" display.
    :
    : i am waiting for your kindly response.
    : Thanks
    :

  • Thanks for your response.
    i will try my best to make the such program.
    Basically i have a FYP ,which object is that making a "Plotter Robot".
    Plotter Robot has the ability to draw the sketch of any picture.
    Since my Robot can sketch only with one color (Black Color).
    Thus it is necessary to convert the image in the sketch style means that robot pick the only dark pixels from the image and draw the these dark pixels.

    My next question is that, is it necessary to conversion of images for "Plotter Robot"?Can i pick the only dark pixels? so that i could convert these pixels into the specific code /machine code so that "Plotter Robot" could understand.

    .......................Thanks

  • Im guessing if you loop through the bitmap pixels and based on the pixels coordinate and color you will be able to write a translator for your robot.

    Each pixel has a color you can analyze for darkness.

    This post ...

    http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=39&MsgID=330064&Setting=

    ... I wrote a while ago, should give you a better understanding on how to loop through pixels. The last example on the page is written in C# and is the fastest method of the 4 I show. Note that the other examples are in VB.NET.


    : Thanks for your response.
    : i will try my best to make the such program.
    : Basically i have a FYP ,which object is that making a "Plotter Robot".
    : Plotter Robot has the ability to draw the sketch of any picture.
    : Since my Robot can sketch only with one color (Black Color).
    : Thus it is necessary to convert the image in the sketch style means that robot pick the only dark pixels from the image and draw the these dark pixels.
    :
    : My next question is that, is it necessary to conversion of images for "Plotter Robot"?Can i pick the only dark pixels? so that i could convert these pixels into the specific code /machine code so that "Plotter Robot" could understand.
    :
    : .......................Thanks
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories