Colour Filter

Angus

Angus Higgins
I have just created this simple colour filter, it is still in its early stages, but I would appriciate any input into it as I would like to possibly encorparate the algorithm used here into another project. At the moment in the program you browse for an image then select a colour for it to filter out (it can only filter one colour at the moment so try to use block colours for the best effect) then you press 'Filter' and a second picture box shows the image with the area of colour that you wanted filtered out displayed as white. The program simply uses the .GetPixel in Bitmap and searches every pixel. If you have any suggestions as to another way of doing it please let me know as I am eager to make this application more effecient. <BR><BR>Angus Higgins
Posted by Angus // Sat, May 21, 2005 3:36 AM

I have just created this simple colour filter, it is still in its early stages, but I would appriciate any input into it as I would like to possibly encorparate the algorithm used here into another project. At the moment in the program you browse for an image then select a colour for it to filter out (it can only filter one colour at the moment so try to use block colours for the best effect) then you press 'Filter' and a second picture box shows the image with the area of colour that you wanted filtered out displayed as white. The program simply uses the .GetPixel in Bitmap and searches every pixel. If you have any suggestions as to another way of doing it please let me know as I am eager to make this application more effecient.

Angus Higgins
[Save]
  NeoTOM
  The Internet makes you stupid
 
  Fri, May 20 2005 8:05 PM
  SvendTofte
 
 
  Sat, May 21 2005 1:50 PM
it must be immensely slow if it's using GetPixel. Rewrite to it is using pointers (assuming C# here)   

  Angus
  Angus Higgins
 
  Sat, May 21 2005 2:13 PM
I haven't added a dynamic resize to it so it isn't too slow, but that is one of the things I'm hoping to change, I want to make it more efficient, but my basic knowledge of c# doesn't allow me to do this.

Angus Higgins

  PeterH
  Iomesus
 
  Sat, May 21 2005 4:30 PM
Out of interest: How would it work with pointers? It's just that I would do it in the way Angus here has done it. What are pointers and how would the code be implimented?