Open ByteYIFFF opened 3 years ago
For me 0,8s on a 4770k CPU including writing two images to JPEG:
$ time heif-convert 2021-10-20\ 112837.heic out.jpg
File contains 1 images
Written to out.jpg
Auxiliary image written to out-urn:com:apple:photo:2020:aux:hdrgainmap.jpg
real 0m0,843s
It should be at least two times faster (mobile i5-8279U). See #551 and #555.
In [1]: from HeifImagePlugin import Image, pyheif
In [2]: data = open('./2021-10-20 112837.heic', 'rb').read()
In [3]: %%time
...: heif_file = pyheif.read(data, apply_transformations=False)
...: image = Image.frombytes(
...: heif_file.mode, heif_file.size, heif_file.data,
...: "raw", heif_file.mode, heif_file.stride)
...:
CPU times: user 709 ms, sys: 79.5 ms, total: 788 ms
Wall time: 279 ms
the problem still exists。And heif_decode_image runs slowly. Is it related to my libheif version? Are you using the master branch?
It should be at least two times faster (mobile i5-8279U). See #551 and #555.
In [1]: from HeifImagePlugin import Image, pyheif In [2]: data = open('./2021-10-20 112837.heic', 'rb').read() In [3]: %%time ...: heif_file = pyheif.read(data, apply_transformations=False) ...: image = Image.frombytes( ...: heif_file.mode, heif_file.size, heif_file.data, ...: "raw", heif_file.mode, heif_file.stride) ...: CPU times: user 709 ms, sys: 79.5 ms, total: 788 ms Wall time: 279 ms
my cpu is i7-8700K. my version is v.1.12.0. @homm
hi.guys~ i know why it takes too much time for decoding.Because I choose to acquire RGB data.if i acquire yuv, the decoding will be qiuck.
对于我在 4770k CPU 上的 0.8 秒,包括将两个图像写入 JPEG:
$ time heif-convert 2021-10-20\ 112837.heic out.jpg File contains 1 images Written to out.jpg Auxiliary image written to out-urn:com:apple:photo:2020:aux:hdrgainmap.jpg real 0m0,843s
please,try to transform HEIC to a PNG picture. i guess that it will need more time to decode. @farindk
So it takes 4 seconds for 4K image to encode in PNG, right?
So it takes 4 seconds for 4K image to encode in PNG, right?
"i know why it takes too much time for decoding.Because I choose to acquire RGB data.if i acquire yuv, the decoding will be qiuck."------this is my guess.
in my computer, for a 4K heic, it takes 2second to run this code (heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGBA, nullptr) @homm
所以 4K 图像在 PNG 中编码需要 4 秒,对吗?
in fact, when i decode image in YCBCR, the time not reduce. @homm
Why are heic images about 10 times slower than jpg? (generate thumbnails) Because heic doesn't have hardware acceleration?
Is there any way to speed up decodin. e.g.:heif_decode_image 2021-10-20 112837.zip g