}
return null;
}
private Image indexedModel(byte bdata[], int bpc, int paletteEntries) throws BadElementException {
Image img = new ImgRaw(width, height, 1, bpc, bdata);
PdfArray colorspace = new PdfArray();
colorspace.add(PdfName.INDEXED);
colorspace.add(PdfName.DEVICERGB);
byte np[] = getPalette(paletteEntries);
int len = np.length;
colorspace.add(new PdfNumber(len / 3 - 1));
colorspace.add(new PdfString(np));
PdfDictionary ad = new PdfDictionary();
ad.put(PdfName.COLORSPACE, colorspace);
img.setAdditional(ad);
return img;
}