Reputation: 1408
The title pretty much sums up the question but I was wondering if JPG/PNG files have a notable difference in speed and performance when using CIFilter
s. Is using one type of file preferred over the other? Is there another file type that could be potentially faster than both JPG and PNG?
Upvotes: 0
Views: 2966
Reputation: 21617
JPEG and PNG are storage mechanism. Filters have to be performed on uncompressed data, not on JPEG or PNG streams.
The speed difference between JPEG and PNG occurs reading or writing. PNG compression generally is slower than JPEG compression. PNG expansion is generally faster than JPEG.
JPEG is not suitable for images that have abrupt changes in color, e.g. drawings, cartoons.
JPEG is not suitable for images that are stored, retrieved, modified, stored . . . . Each cycle changes the image.
JPEG generally produces much smaller compressed streams than PNG.
Upvotes: 3
Reputation: 1351
It actually depends! PNG's are better if it is a smaller image, as it cuts away the white surrounding what is actually there. But, it does not compress at all to maintain quality. This could slow down performance. JPEG compresses, therefore cutting down file size, but also compromising quality to a point. I'd say go for JPEG if it is a huge image for the app, but go for PNG if you want quality.
Thanks for asking and hope this helps. If this answers your question, I'd love if you could just hit that check mark.
Cheers, Theo
Upvotes: 1