Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Image Processing [modified]

Image Processing [modified]

Scheduled Pinned Locked Moved C#
graphics
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    erfi
    wrote on last edited by
    #1

    Hi. I want to do some works with a picture and need to work with pixels. but the getpixel(,),setpixel(,,) functions in a loop are very slow. is there a way to get or set pixels faster. my code is like this:

    Bitmap myBmp = new Bitmap("filename");
    Color p = new Color();
    int i,j;
    for(i=0 ; i < myBmp.Width ; i++)
    {
    for(j=0 ; j < myBmp.Height ; j++)
    {
    p = myBmp.GetPixel(i,j);
    if(p.R <= 250) p.R += 5;
    if(p.G <= 250) p.G += 5;
    if(p.B <= 250) p.B += 5;
    myBmp.SetPixel(i,j,p);
    }
    }

    erfan -- modified at 8:01 Sunday 23rd July, 2006

    modified on Thursday, February 12, 2009 5:07 AM

    M 1 Reply Last reply
    0
    • E erfi

      Hi. I want to do some works with a picture and need to work with pixels. but the getpixel(,),setpixel(,,) functions in a loop are very slow. is there a way to get or set pixels faster. my code is like this:

      Bitmap myBmp = new Bitmap("filename");
      Color p = new Color();
      int i,j;
      for(i=0 ; i < myBmp.Width ; i++)
      {
      for(j=0 ; j < myBmp.Height ; j++)
      {
      p = myBmp.GetPixel(i,j);
      if(p.R <= 250) p.R += 5;
      if(p.G <= 250) p.G += 5;
      if(p.B <= 250) p.B += 5;
      myBmp.SetPixel(i,j,p);
      }
      }

      erfan -- modified at 8:01 Sunday 23rd July, 2006

      modified on Thursday, February 12, 2009 5:07 AM

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! Just use the search function to find Christian Grauss' excellent articles on image processing.

      Regards, mav -- Black holes are the places where god divided by 0...

      E 1 Reply Last reply
      0
      • M mav northwind

        Hi! Just use the search function to find Christian Grauss' excellent articles on image processing.

        Regards, mav -- Black holes are the places where god divided by 0...

        E Offline
        E Offline
        erfi
        wrote on last edited by
        #3

        thanks what is the article's name?

        M R 2 Replies Last reply
        0
        • E erfi

          thanks what is the article's name?

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          :wtf: My answer was that there are articles here on CP telling you how to solve your problem, you just have to search! If you're unable to find the search button, you can try this page instead.[^]

          Regards, mav -- Black holes are the places where god divided by 0...

          1 Reply Last reply
          0
          • E erfi

            thanks what is the article's name?

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            This[^] article is the first of several. /ravi

            My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups