PDPixelMap.createImageStream() makes the assumption that BPC is 8. This is not always correct, and it results in the weird effects described here:
I can confirm this by using GIF files. It happens both with bitonal and color GIF files. I have fixed it by using some of my code from the trunk from LosslessFactory.createFromImage(). That code is slower and longer, but is safer because it avoids making assumptions about the low level data, as in the line with "rgbImage.getData().getDataElements()".
I will also uncomment the "new PDPixelMap" segment in the ImageToPDF examples.