public Bitmap getImg(int compressionlevel) { if (compressionlevel == 2) { OctreeQuantizer quantizer = new OctreeQuantizer(255, 8); // 255 colors, 8 bits... return quantizer.Quantize(img); } else if (compressionlevel == 3) { OctreeQuantizer quantizer = new OctreeQuantizer(63, 6); // 63 colors, 6 bits... return quantizer.Quantize(img); } else if (compressionlevel == 4) { OctreeQuantizer quantizer = new OctreeQuantizer(15, 4); // 15 colors, 4 bits (very low quality)... return quantizer.Quantize4bpp(img); } else return img; }
public Bitmap getImg(int compressionlevel) { if (compressionlevel == 2) { OctreeQuantizer quantizer = new OctreeQuantizer(255, 8); // 255 colors, 8 bits... return(quantizer.Quantize(img)); } else if (compressionlevel == 3) { OctreeQuantizer quantizer = new OctreeQuantizer(63, 6); // 63 colors, 6 bits... return(quantizer.Quantize(img)); } else if (compressionlevel == 4) { OctreeQuantizer quantizer = new OctreeQuantizer(15, 4); // 15 colors, 4 bits (very low quality)... return(quantizer.Quantize4bpp(img)); } else { return(img); } }