Use PixelFormat.getValueType() instead of .getBytesPerComponent() to identify value type.