Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
新しい画像フォーマットHEIFを 用いたiOSアプリの通信量削減/iosdc-heif
Search
Taketo Yoshida
September 17, 2017
Programming
6.7k
9
Share
新しい画像フォーマットHEIFを 用いたiOSアプリの通信量削減/iosdc-heif
9/16 10:30 ~ 10:45 Track A で発表した資料です
Taketo Yoshida
September 17, 2017
More Decks by Taketo Yoshida
See All by Taketo Yoshida
Beautiful Japanese line break for the Web
tamanyan
1
520
Source Code Generator for Team Development/code-generator-for-team-development
tamanyan
0
1.7k
How to Design Great Alerts/how-to-design-great-alerts
tamanyan
0
650
iOSエンジニアがReact-Nativeに触れてみた/ios-developer-react-native
tamanyan
0
490
フォーシームのスピン量とその効果/the-effect-of-fourseam-fastball-spin-rate
tamanyan
1
930
Objective-CからSwift移行を始めて感じた事/ObjC-to-Swift
tamanyan
1
1.5k
Modern and Practical Networking in Swift
tamanyan
2
820
まだJPEGで消耗してるの?/iOSDC-Reject-Conference
tamanyan
0
3.1k
SwiftでWebPを使ってみた/melon-swift-webp
tamanyan
1
1.5k
Other Decks in Programming
See All in Programming
From Formal Specification to Property Based Test
ohbarye
0
1.2k
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
100
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
190
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
220
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
490
My daily life on Ruby
a_matsuda
3
190
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
110
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
180
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
450
Agentic Elixir
whatyouhide
0
440
AIを導入する前にやるべきこと
negima
2
340
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Design in an AI World
tapps
1
210
The browser strikes back
jonoalderson
0
1k
Amusing Abliteration
ianozsvald
1
160
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
The Invisible Side of Design
smashingmag
302
52k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
180
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
240
Transcript
新しい画像フォーマットHEIFを ⽤いたiOSアプリの通信量削減 iOSDC 2017 Sun Sep 16 Taketo Yoshida
2 Taketo Yoshida @TamaObject12 ⽇本経済新聞社のiOSエンジニア ⽇経電⼦版アプリ、紙⾯ビューアーアプリの開発
3 HEIFとは…
4 High Efficiency Image File Format
5 次世代の画像フォーマット
6 WWDC17にてiOS11から HEIFを使⽤できる事が分かりました
7 H.265/HEVCでエンコードされた イントライメージを利⽤している 特徴その1
8 Live Photosなどの シーケンス画像を効率よく保存 特徴その2
9 深度マップや透明度などの 補助データに対応 特徴その3
10 本⽇話す事 HEIFがどのようにmacOSやiOSで使⽤されているか 紙⾯ビューアアプリのHEIFの導⼊実験の話
11 HEIFに触れてみる
iOS11のiPhone7(A10 chip)で写真を撮る
13 PHAssetのrequestContentEditingInput を使ってファイルのパスを取得してみる
// Photo image url: file:///var/mobile/Media/DCIM/102APPLE/IMG_2252.HEIC
15 取った写真はHEIFで保存されています
16 Webにアップロードする時は どうすればいいん?
17 HEIFからJPEGに⾃動で変換されます※ HEIF to JPEG ※ PhotoKitやUIImagePickerControllerを普通に使えば問題ないです
Previewで普通に閲覧できる (なおSafariでは無理な模様)
19 HEIF Decode サポート iPhone Mac Hardware Decode A9 Chip
(iPhone 6S, iPad Pro) 6th Generation Intel Core (Skylake family of processors.) Software Decode All iOS Devices All Macs HEIF Encode サポート iPhone Mac Hardware Decode A10 Chip (iPhone7) None
20 ⽇経の朝刊画像をHEIF/WebP/JPEG に変換して⽐べた話
21 その前に紙⾯ビューアーアプリの話を
22 紙⾯ビューアーアプリの歴史 2012年3⽉ リリース 当時は外注開発 JPEG画像で紙⾯配信
内製開発、Swift移⾏ 23 紙⾯ビューアーアプリの歴史 WebP画像で紙⾯配信 サーバレスアーキテクチャが少し話題に 2016年3⽉ リニューアル
24 2016年3⽉ 2012年3⽉ 201?年??⽉ JPEG時代 WebP時代 HEIF時代?
25 HEIF導⼊のために評価を⾏う
26 HEIF/WebP/JPEGでSSIMの値を⾒て同程度の画質に※ 朝刊画像⼀週間分を変換 HEIFの作成はffmpeg, GPAC/MP4Boxを利⽤ ※ SSIMの値が⼤体0.963 ~ 0.998の間に収まるように JPEGとWebPはImageMagickで作成
27 JPEG HEIF HEVC intra image ffmpeg GPAC/MP4Box HEIF作成の流れ
$ ffmpeg -i {source.png} -y -pix_fmt yuv420p \ -codec:v libx265
-crf 13 -preset slower \ -x265-params ssim=1 -f hevc {output.hvc} 画質測定のためにx265のオプションにSSIMする HEIFのHEVCイントライメージを作成
$ MP4Box -add-image {source.hvc} -ab heic \ -new {output.heic} GPAC/MP4BoxでHEIFを作成する
30 実験結果
31 0 30 60 90 120 8/21 8/22 8/23 8/24
8/25 8/26 8/27 HEIF [MB] WebP [MB] JPEG [MB] 朝刊画像の各フォーマットの合計サイズ
32 0 30 60 90 120 8/21 8/22 8/23 8/24
8/25 8/26 8/27 HEIF [MB] WebP [MB] JPEG [MB] 朝刊画像の各フォーマットの合計サイズ 32%削減
33 0 30 60 90 120 8/21 8/22 8/23 8/24
8/25 8/26 8/27 HEIF [MB] WebP [MB] JPEG [MB] 朝刊画像の各フォーマットの合計サイズ 52%削減
34 JPEGと⽐べて、約50%通信量を削減可能 A9 chip以降ならばハードウェアデコード可能
35 HEIF最⾼や!JPEG、WebPなんて 最初っからいらんかったんや!
36 しかし…
37 商業⽬的でffmpeg, GPAC/MP4Box を使うのは特許使⽤の観点から 正直怪しい IANAL ɹɹɹɹɹɹɹɹ㱸㱸 ɹɹɹɹɹɹʋ ŋТŋ ɹɹţƄŠŖ
ɹɹɹɹɹʘ ʘϊ ɹɹɹɹŊŰ Ŋɹʉ ɹɹɹɹʉ
38 ffmpegなどを使ってHEIF 作成しても商業利⽤できないので 気をつけてくださいね
39 それでも僕はHEIFを使いたいので ⼒技でも実現できるように考えてみました
紙⾯ビューアーアプリ朝刊⾃動ダウンロード 紙⾯画像⽣成
紙⾯ビューアーアプリ朝刊⾃動ダウンロード 紙⾯画像⽣成 これだ!!
42 ※ デバイストークンの管理については⼀度無視 紙⾯画像確認 メタデータ更新 朝刊のページ分 ✕ N 回 SQSに積む
Polling Notifier Download HEIF Encode & Upload 社内のiPhone Cluster Silent Remote Notification 紙⾯画像置き場 ①画像確認 ② ③ ④ ⑤ ⑥
43 ※ デバイストークンの管理については⼀度無視 紙⾯画像⽣成 朝刊のページ分 ✕ N 回 SQSに積む Polling
Notifier Download HEIF Encode & Upload 社内のiPhone Cluster Silent Remote Notification 紙⾯画像置き場 ①画像確認 ② ③ ④ ⑤ ⑥ 取りこぼし防⽌のために⼀つの端末に通知をN回送る スケジューラが何度も起動して反映されてるか確認 iPhoneの台数は朝刊の最⼤ページ数の48個程度⽤意
44 問題点 画像反映スピード システム全体の可⽤性 iPhone爆買いを上に説得すること
45 最後に
46 High SierraとiOS11からHEIFの利⽤が可能 AppleがServerSide-HEIFに対応するのを期待 HEVCやHEIFは特許問題でドロドロしてる 1 2 3
47 ありがとうございました