ColorQuantization
Jan 2019
Matthew Yu C++ Program for quantizing colors in images using an implementation of the median cut algorithm.
INSTRUCTIONS (ubuntu/linux):
- With the binary imgQuant and a /data folder with images in it
- run ./imgQuant
- type a file in /data to access (i.e. 'launch.png')
- enter a max bucket size (larger images tend to output a smaller percentage of bins than max)
- enter image scaling (>= 1, rec is 1|2)
- Quantized picture outputs!
OPTIONAL COMMANDS
After generating the picture, OfApp accepts the following commands by keyboard:
- 's': saves the image under 'Color_Quant[i].jpg' (colors are inverted though for some reason)
- 'r': reruns the program (enter in different input)
- 'c': returns the credits and exits the program (Program can also be exited by ctrl+c in the console or esc in the window).
If you're interested at looking at the OF code for colorQuantizer to make this program, please contact me.
BUGS (OR FEATURES) to be fixed:
- Program crashes trying to load an invalid image. (currently no error checking for OF img.load(), although it can be fixed through checking the file path)
- Solution: rerun the program again with valid image name.
- Program crashes when image scaling inputted is 0 or NaN. (typechecking and bounds checking upcoming).
- Solution: input a number >= 1