JPEG encoder for practice