@Override
        public SampleModel createCompatibleSampleModel(int width, int height) {

            if (bitsPerComponent >= 8) {
                assert bitsPerComponent == 8 || bitsPerComponent == 16;
                final int numComponents = getNumComponents();
                int[] bandOffsets = new int[numComponents];
                for (int i=0; i < numComponents; i++) {
                    bandOffsets[i] = i;
                }
                return new PixelInterleavedSampleModel(
                        getTransferType(), width, height,
                        numComponents,
                        width * numComponents,
                        bandOffsets);
            } else {
                switch (getPixelSize()) {
                    case 1:
                    case 2:
                    case 4:
                        // pixels don't span byte boundaries, so we can use the standard multi pixel
                        // packing, which offers a slight performance advantage over the other sample
                        // model, which must consider such cases. Given that sample model interactions
                        // can dominate processing, this small distinction is worthwhile
                        return new MultiPixelPackedSampleModel(getTransferType(),
                            width,
                            height,
                            getPixelSize());
                    default:
                        // pixels will cross byte boundaries
                        assert getTransferType() == DataBuffer.TYPE_BYTE;
                        return new PdfSubByteSampleModel(width, height, getNumComponents(), bitsPerComponent);
                }
            }
        }