Creates an image XObject from a PNG file, or returns the one this document already has for the same file.
public PdfImage CreateImageFromPng(ReadOnlySpan<byte> png)
The PNG file: any colour type and bit depth, interlaced or not.
ISO 32000-2 §8.9.5 (Table 87), §7.4.4 (FlateDecode with the PNG predictors, Table 8) and §11.6.5.2 (soft-mask images); ISO/IEC
15948. The samples keep their bit depth (1 to 16). A file that is not interlaced and has no alpha channel keeps its own
compressed data, which is already FlateDecode data with PNG predictors (Predictor 15); any other is decoded and
compressed again the same way, without interlacing. Greyscale is DeviceGray, truecolour DeviceRGB,
indexed-colour an Indexed space over DeviceRGB with the PLTE table; an iCCP profile of the right number of
components replaces the device space with an ICCBased space (one PDF allows, Table 67; any other profile is ignored).
Gamma, chromaticity and sRGB chunks are not applied.
An alpha channel, or a tRNS table of an indexed-colour image, becomes a soft-mask image (SMask, PDF 1.4) of the same
size: 8-bit for a palette, the image's depth otherwise; an image whose every pixel is opaque gets none. The tRNS colour of a
greyscale or truecolour image becomes a colour key mask (Mask, PDF 1.3, §8.9.6.4). 16-bit samples are PDF 1.5. Each
feature's version is recorded. A mutation.