All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blitline.image.functions.Quantize Maven / Gradle / Ivy

package com.blitline.image.functions;

import org.apache.commons.lang3.Validate;

public class Quantize extends AbstractFunction {
	@Override
	public String getName() {
		return "quantize";
	}
	
	public Quantize(int numberOfColors) {
		Validate.isTrue(numberOfColors > 1, "can't quantize to fewer than 2 colors");
		params.put("number_colors", numberOfColors);
	}
	
	public Quantize inColorSpace(String colorSpace) {
		params.put("color_space", colorSpace);
		return this;
	}
	
	public Quantize withDithering() {
		params.put("dither", Boolean.TRUE);
		return this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy