What are the image file formats supported by UIImage?
I managed to find this documentation page but is is quite old and outdated I assume since it does not even include PDF.
What are the image file formats supported by UIImage?
I managed to find this documentation page but is is quite old and outdated I assume since it does not even include PDF.
Actually the UIImage
itself should have no direct correlation to formats you are looking for and you will need to add more context. UIImage
is just a representation of raw pixel data such as 32bit RGBA.
A more contextual question would be; what are supported formats to initialize UIImage
by using init(contentsOfFile:)
method which is described here. Unfortunately even this part seems to lack documentation for what formats it supports though.
In parent documentation I can only see mentioning of PNG and JPEG formats. And trying to initialize it with a pdf actually results as a fail and returns nil
.
But then on the other hand pdf is supported in assets which is a completely different thing. Quickly inspecting web I can find no proper documentation from Apple about it (Though I assume it must be somewhere) but there is this very nice post about it you should read. Basically it states that PDFs are actually converted to PNGs at build time.
So perhaps the information you posted is not outdated at all.