|
-
Apr 15th, 2004, 04:36 PM
#1
Thread Starter
Fanatic Member
Simplify colours in an image, effectively replace the palette
I have an application where I load an image into a picturebox.
What I want to do is simplify the colours.
I have the following colours
white
light blue
dark blue
yellow
pink
red
dark red
black
light green
dark green
light grey
dark grey
orange
there are a few others but these are a most of them.
So for each pixel in the image I want to replace it with the closest match from above.
I believe there are two possible ways of doing this;
[list=1][*]for each pixel compare its value with the list above and find the closest match then replace it with that.[*]replace the palette of the image by assigning it the palette of another image , I believe it can be don like so
bitmapobject.palette = anotherbitmap.palette.[/list=1]
It was suggested that the system.drawing.imaging.colorpalette (or something like that) could be used but despite my looking for ages I have not found any examples.
Can anyone suggest which way is best, or another way if there is a better one.
Also any code examples would be appreciated.
Many thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|