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
shimayuu
August 26, 2025
Programming
150
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
280
Other Decks in Programming
See All in Programming
カツオ、ご期待ください
suneo3476
0
190
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.6k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
ジョジョの世界をXRで再現する
mofurune
0
160
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
0
170
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
680
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
Railsバージョンを4倍にした話
optim
0
370
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
The Rails Doctrine Decade
koic
2
590
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
The Curious Case for Waylosing
cassininazir
1
570
Designing for Performance
lara
612
70k
Thoughts on Productivity
jonyablonski
76
5.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/