Message Boards Message Boards

0
|
5225 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Convert an image with continous colour to an image with n discrete colours

Posted 10 years ago

Hi, I have a 2D image with continuous colours and I want to convert it into an image with n discrete colours. If possible can you give two examples one with a user-defined "n" discrete colours, and the other one using the dominant colours of the original image ( I mean to present a picture only interms of its dominant colours)?

POSTED BY: H H

ColorQuantize should do what you're suggesting. Here is an example that you can try:

im = LinearGradientImage[{Red, Blue}];
ColorQuantize[im, 4]

where I have specified that 4 colors should be displayed. See the doc page for ColorQuantize for more information.

POSTED BY: Chad Knutson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract