简体   繁体   中英

Matlab Image Processing Pixelating

So what I'm trying to do is to convert a user inputted image to a more pixelated image constrained to only using a few colors.

Essentially, input an image, reduce the number of pixels that make up the image, and only allow the pixels be of user specified colors.

I'm not sure if Matlab Image Processing Tool Box has any function that can accomplish this sort of task. I have some knowledge regarding color matching but am curious if the image processing toolbox can assist in anyway.

I think what you are looking for is the function

[output, map] = rgb2ind(input, ncolors)

input is your input image, ncolors is the number of colors to reduce to <= 65536, and [output,map] are the output image and new colormap respectively.

More documentation on the Mathworks site at: Mathworks reducing number of colors in image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM