Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 1368. Create an 8-color version of an image

Created by Matt Eicholtz

This problem was inspired by a tweet I saw from @MATLAB regarding The Warholer.

Given an MxNx3 array (A) representing an image and a threshold for each channel (r/g/b), generate a new array (B) whose elements are 255 if greater than the threshold for that channel or 0 otherwise. This means the new "image" will only have 8 colors.

You may assume that the inputs are on the interval [0,255].

Problem Group

Solution Statistics

18 correct solutions 23 incorrect solutions
Last solution submitted on Nov 02, 2014

Solution Comments