Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
hate HEIC
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shimayuu
August 26, 2025
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
hate HEIC
webにおける画像の扱い方やHEIC形式の変換について書いてます
shimayuu
August 26, 2025
More Decks by shimayuu
See All by shimayuu
CyberAgent YJC Connect
shimaf4979
1
260
Other Decks in Programming
See All in Programming
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
390
What We Talk About When We Talk About XP
m_seki
2
680
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.9k
Verilogで学ぶCPU自作入門.pdf
uyuki234
2
1.6k
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
310
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.1k
Security issues being discussed on Web Platforms
petamoriken
0
1.2k
一人だけ、Kiroが静止する日
hideg
0
130
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
170
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
160
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
370
SREの越境 / SRE Collaboration
y0hgi
2
270
Featured
See All Featured
For a Future-Friendly Web
brad_frost
183
10k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Visualization
eitanlees
152
17k
Navigating Weather and Climate Data
rabernat
0
530
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Odyssey Design
rkendrick25
PRO
2
810
The Pragmatic Product Professional
lauravandoore
37
7.4k
Transcript
shimayuu(Asa) 個人開発における HEIC形式との向き合いかた BEELT#11
大前提:ほとんどのプレビューはピクセル列である 簡単な例 : RGBAの場合 ピクセル ピクセル = 構成する最小の点
大前提:ほとんどのプレビューはピクセル列である Red,Green,Blue,Alphaを8bit(0~255)で表す 一つのピクセル = 8*4 = 32bit =4byteを持つ 縦、横ともに3つずつピクセル 4
* 3 * 3 = 36byte
大前提:ほとんどのプレビューはピクセル列である 3000*1600の写真なら...(単純計算) 4 * 3000 * 1600 = 19200000byte ≃
18.8MB (1MB = 1024byte)
圧縮とは 圧縮の一例:Run-Length Encoding (RLE)
圧縮とは(可逆圧縮) エンコード デコード ほぼ同じ
見ているものはデコードされたもの ハードウェアレベルだから超速い エディタで見れないのは デコード機能ないから
圧縮とは その他:DCT(離散コサイン変換)、イントラ予測 圧縮手法_WebP_Google for Developers https://developers.google.com/speed/webp/docs/compression?hl=ja 人間は色相よりも輝度に敏感 色相の解像度を下げちゃえ (Chroma Subsampling)
そもそも予測できたら良くね? 分割もっと多かったら良くね?
非可逆圧縮とは 圧縮したら完全な状態には戻せない 違う
HEICのアルゴリズム HEVC/H.265 ビデオ圧縮技術 がベース 単純な圧縮効率はHEIC>webP 「HEIF コンテナに HEVC を格納したファイル」であり
デコードが遅い、利権の問題で普及しずらかった(昔) https://www.mc-if.org/hollywood-workshop
Apple製品における自動補完機能早見表(実験済み) iOS Mac 写真アプリからなら どのブラウザでもjpegに自動変換 ファイルアプリからは送信できる Webkitブラウザ(Safari)はaccept明示で 変換、表示は可能 他のブラウザは変換されず、ブラウザ上 でほとんど表示できない
(ファイル自体は受け取れる)
なぜ自動変換 @umashiba(umashiba) Webブラウザ、レンダリングエンジン、JavaScriptエンジンの整理&図視化 https://qiita.com/umashiba/items/8cb47825624c5cb043d6 よく見るやつ
Webkit なぜ自動変換(iOSの場合) @umashiba(umashiba) Webブラウザ、レンダリングエンジン、JavaScriptエンジンの整理&図視化 https://qiita.com/umashiba/items/8cb47825624c5cb043d6 Appleがwebkit強制 ↓ どのブラウザから でも変換できる
時代の変化 EUで規制解除 Apple Inc. https://www.apple.com/newsroom/2024/01/apple-announces-changes-to-ios-safari-and-the-app-store-in-the-european-union/
時代の変化 日本でも新法成立で変わるかも 【スマホソフトウェア競争促進法、2025年12月〜】 BUSINESS LAWYERS 、スマホ競争促進法とは?アプリ提供者への影響を弁護士が解説 https://www.businesslawyers.jp/articles/1422
時代の変化 20xx年問題 HEICユーザーがブラウザの選択へ @umashiba(umashiba) Webブラウザ、レンダリングエンジン、JavaScriptエンジンの整理&図視化 https://qiita.com/umashiba/items/8cb47825624c5cb043d6
時代の変化 考察:あんま変わんなそう ①EUの現状→ほとんど変わっていない ②Appleの言い分もすごく筋が通っている https://www.jftc.go.jp/file/241205_gijiroku_4.pdf 令和6年12月5日(木) スマートフォンにおいて利用される特定ソフトウェアに係る 競争の促進に関する検討会(第4回)議事録
どこに刺さるか ・高画質写真管理をする人 ・webKit縛り撤廃を見据えてる人 ・脱獄iOS向けサイトを考えている人
実装編
実装方法一覧 フロント→heic2any→メモリすごい食う 汎用API→cloudflare,cloudinary→高いよ 😭 サーバー→そんなユーザーいる? サーバーレス→c++ライブラリきついよ
計測時間 EC2でlibvips+libheif(C++)→早すぎる lambdaでsharpライブラリ(libheifをリンク)→面倒
保守性 個人開発において大事なこと 拡張性 料金 1 4 95 : :
現在の設計
Docker buildxでもかなりmakeに失敗する libheif libvips libaom x265 libde265 Macだと環境が合わない sharp +
権利の問題でライブラリ にはlibheif関連含まれてないよ
Macだと環境が合わない DockerはLinux上だけ MacだとVMの上 ホスト依存も一部有
Macだと環境が合わない ならちゃんとLambda環境でビルドしよう libheif libvips libaom x265 libde265 レイヤーだと 256MBまで レイヤー
現在の設計
ありがとうございました! https://www.pamfree.com/