Png Image Did Not Start With Ihdr. However if the decoder wishes to recover the original data at its original precision this can be done by right shifting the stored samples the stored palette entries for an indexed color image. Firstly the ihdr chunk which contains important metadata such as the width height of the image bit depth etc.
The export as is trying to as best i can tell downgrade the to a lower color bit and for whatever reason does a horrible job of it. The output of the code in console is. The format also supports full color non indexed rgb or rgba images and grayscale images.
First set image mode 16 bit.
On 32 bit systems it s int32 and on 64 bit systems it s int64 so on my machine i am converting int64 to uint32 because i am running a 64 bit os. The png spec requires all png files to have ihdr as the first chunk. I have written a code in swift to read the same png file and print the bytes which does not give me an ihdr with length equal to 13 bytes from the first 4 bytes of the chunk after the png signature. It supports indexed palette based 24 bit rgb or 32 bit rgba rgb with a fourth alpha channel color images.