/// <summary> /// /// </summary> /// <param name="image"></param> /// <param name="quality">Quality of the image. 0 to 100 and from bad image quality, high compression to good image quality low compression</param> /// <param name="output"></param> /// <param name="comment"></param> public JpegEncoder(Image image, Stream output, String comment, int quality = 80) { this.quality = quality; // Getting picture information It takes the Width, Height and RGB scans of the image. this.JpegObj = new JpegInfo(image, comment); this.imageHeight = this.JpegObj.ImageHeight; this.imageWidth = this.JpegObj.ImageWidth; this.output = new BufferedStream(output); this.output.SetLength(0); this.dct = new DCT(this.quality); this.huffman = new Huffman(); }