when I am trying to create a .tiff file from BufferedImage ArrayList it always duplicates the first page.
TIFFEncodeParam params = new TIFFEncodeParam();
params.setExtraImages(separatedTiffList.iterator());
OutputStream out = new FileOutputStream("D:\\test\\test1" + ".tif");
ImageEncoder encoder = ImageCodec.createImageEncoder("tiff", out, params);
encoder.encode(separatedTiffList.get(0));
out.close();```
I find the answer, instead of using separatedTiffList.iterator(), I should use separatedTiffList.listIterator(1), to avoid first duplicate