SDWebImage / SDWebImageAVIFCoder

A SDWebImage coder plugin to support AVIF(AV1 Image File Format) image
MIT License
55 stars 14 forks source link

Support libavif v0.60 and set proper color space as possible. #13

Closed ledyba-z closed 4 years ago

ledyba-z commented 4 years ago

Hi.

In this PR, set proper color profile values to CGImage (if possible).

This PR and https://github.com/AOMediaCodec/libavif/pull/98 may resolve https://github.com/SDWebImage/SDWebImageAVIFCoder/issues/12 .

Please take a look!

codecov[bot] commented 4 years ago

Codecov Report

Merging #13 into master will decrease coverage by 9.84%. The diff coverage is 32.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage   77.02%   67.17%   -9.85%     
==========================================
  Files           4        4              
  Lines        1014     1496     +482     
==========================================
+ Hits          781     1005     +224     
- Misses        233      491     +258
Impacted Files Coverage Δ
SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m 66.94% <32.7%> (-11.24%) :arrow_down:
Example/SDWebImageAVIFCoder/SDViewController.m 88.88% <0%> (+40.74%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ab2fde9...9da58e8. Read the comment docs.

dreampiggy commented 4 years ago

😅 Seems you still trying some changes. If you find it's ready to merge, @ me again.

And, can CI test image been passed after this color space support changes ?

ledyba-z commented 4 years ago

@dreampiggy Sorry! I've done!

And, can CI test image been passed after this color space support changes ?

Unfortunatelly, https://github.com/AOMediaCodec/libavif/pull/98 should also be merged to libavif, and we have to wait the new version release of libavif to fix CI tests.

ledyba-z commented 4 years ago

@dreampiggy Hi! Now libavif v0.6.0 is supported, and all end-to-end tests (Github Actions) have finally passed! Could you take a look?

ledyba-z commented 4 years ago

Thank you!

ledyba-z commented 4 years ago

I tested the new alpha channel codes with plum-blossom-large.profile0.8bpc.yuv420.avif

iPhone 6

v0.5.2 : 2.0247561931610107 sec
master: 1.7678682804107666 sec

It runs faster about 13%

iPhone 8

v0.5.2: 0.7256550788879395 sec
master: 0.5414080619812012 sec

It runs faster about 25%