Write a Processing program to simulate indexed imaging and implement Floyd-Steinberg dithering. The number of colors is set in a variable (ncolors) defined near the top of the program; your program should be able to handle 8 to 256 colors. The setup() function loads an image (with the filename defined by a String variable, loadName, near the top of the program), reads a color palette (determined by the image filename and the number of colors), and calls your functions to create a new image that uses only colors from the palette and then a second image that uses Floyd-Steinberg dithering to reduce artifacts introduced by indexing. Test your program with the following images: ColoredSquares.jpg, colorful-1560.jpg, gumballs.jpg, and Lizard.jpg; I will test it using other images, as well.
The post Write processing program to simulate indexed imaging appeared first on My Assignment Online.