离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser
GIF 转 Markdown——离线、整段内联、不丢帧GIF to Markdown offline — one inline tag, all frames
两步:`gif>html` 把文件的**原始字节**编成 data URI 放进一个 `<img>`(`alt` 与 `title` 都是文件名主干,去扩展名、无名时 `converted`,并做属性转义),`html>md` 再用 Turndown 把这份文档序列化。实测产物是**一行图片语法**:那张 `<img>` 是页面 `body` 里唯一的元素,样式表在 `<head>`、而序列化只取 `body`,所以 CSS 不会漏进 `.md`。对 GIF 而言关键在「不丢帧」:整份动图(每一帧、每一段扩展块)都在那串 base64 里,这一路既没有取首帧也没有重编码;而 GIF→PNG / JPG / WebP / PDF 那几路确实取首帧,并在结果上固定提示只保留第一帧。边界要说清:**帧都在,不等于一定播**——是否播放、循环几遍由打开这份 `.md` 的阅读器决定,本页不替它承诺;`data:` 图片能不能显示也同理,网页端邮件客户端与一些托管站会剥掉它,那种场合请用外链图片。体积按每三字节四字符走,动图往往本就不小,所以整段负载会挤在同一行里,这是内联换来的代价。全程只有 storage 权限,不联网。Two steps: `gif>html` encodes the file’s **raw bytes** into a data URI inside one `<img>` (`alt` and `title` both carry the basename of your file, extension dropped, `converted` when there is no usable name, escaped for attribute position), and `html>md` then serialises the document with Turndown. Measured, the artifact is **one line of image syntax**: that `<img>` is the only element in the page’s body, and the stylesheet sits in `<head>` while the serialisation reads only the body, so no CSS leaks into the `.md`. For a GIF the point is that no frame is lost — every frame, every extension block, is inside that base64, since this route neither grabs the first frame nor re-encodes anything, whereas GIF to PNG, JPG, WebP or PDF does exactly that and shows the same fixed first-frame notice. State the boundary clearly: **surviving frames are not a promise of playback** — whether it animates and how it loops is up to whichever reader opens the `.md`, and this page says nothing for them. The same applies to whether a `data:` picture displays at all: webmail clients and some hosting sites strip it, so use an external reference there. The size runs at four characters per three bytes, and animations are rarely small, so the whole payload sits on one line — that is the cost of inlining. All of it on the storage permission, with no network at all.
这条链路怎么走How the route runs
GIFGIF HTMLHTML MarkdownMarkdown
共 2 步,由扩展的路径搜索自动选出,中间产物不落盘。2 steps, chosen by the extension's own path search; intermediate results never touch the disk.
会保留什么What carries over
- 一帧都不丢:整份动图的字节都在 base64 负载里,不取首帧、不重编码Not one frame lost: the whole animation lives in the base64 payload — no first-frame grab, no re-encode
- 自包含的一行图片语法:拷走单个 `.md` 就带着图,不必带附件目录One self-contained image tag: copying a single `.md` carries the picture with it, no attachments folder needed
- `alt` 与 `title` 带你的文件名主干,可继续编辑成有意义的描述`alt` and `title` carry your file’s basename, ready for you to edit into something meaningful
- 样式表不会漏进产物:那一步只取文档 `body`,head 里的 CSS 不参与No stylesheet leaks: the serialisation reads the document body only, leaving the head’s CSS out
- 一批最多 200 个文件、单个 100 MB,与其他路线共用同一道闸门Up to 200 files per batch and 100 MB each — the same gate every other route shares
如实说明的限制What it does not do
- 不保证会动:帧都还在,但播放与循环由打开这份 `.md` 的阅读器决定Motion is not promised: the frames all survive, but playback and looping belong to whichever reader opens the `.md`
- `data:` 图片能不能显示由收件端决定:网页端邮件客户端与一些托管站会剥掉它,那种场合请用外链图片Whether a `data:` picture displays is up to whatever receives it: webmail clients and some hosting sites strip it, so use an external reference there
- 不做 OCR:图里印着的文字不会变成 Markdown 文字,这条路连像素都不读No OCR: text printed in the picture never becomes Markdown text, because this route never reads pixels
- 体积只增不减,而且整段 base64 挤在同一行——这是内联的代价,想要可 diff 的形状请改外链The file only grows and the whole payload sits on one line — the cost of inlining, and the reason an external reference is the diffable shape
- 一行一文件:只包一张图,多张请分别转换,或自己写成标准外链图片语法One picture per file: convert separately, or write a normal external image reference for several
实操提示Working with it
- 只想放进网页:GIF→HTML 就是这条的第一步,产物是 HTML 而不是 `.md`To put the picture in a web page: GIF to HTML is this route’s first step, and the artifact is HTML rather than `.md`
- 要进 Word:GIF→Word 与这条共享第一步,那条 data URI 在进 Word 时换成包里的图片部件For a Word file: GIF to Word shares this first step, and that data URI becomes an image part inside the package
- 要真的换格式:GIF→PNG / JPG / WebP 会重编码,也就只剩首帧(结果会固定提示只保留第一帧)To actually re-encode: GIF to PNG, JPG or WebP keeps the first frame only and shows that fixed first-frame notice
常见问题Questions people actually ask
把 GIF 转成 Markdown 会丢掉动画吗?Does converting a GIF to Markdown kill the animation?
不会丢数据:这一路把整份文件的字节原样编进 base64,没有取首帧也没有重编码,所以每一帧都在。真正会丢动画的是「换成 PNG / JPG」那类需要重编码的路线。至于读这份 Markdown 的那一侧播不播,是它的显示决定,本扩展不替它保证。No data is lost: the route encodes the file’s bytes verbatim into base64, with no first-frame grab and no re-encoding, so every frame is present. What actually kills the animation is a route that must re-encode — PNG or JPEG. Whether the reader animates it is that reader’s display decision, which this extension does not make.
为什么我的 `.md` 里有一行长得离谱?Why is one line of my .md absurdly long?
因为整张动图都内联在那一行里:base64 每三个字节写成四个字符,而序列化只产出一行图片语法。想要「文字在文件里、图在目录里」那种可 diff、可读的形状,请自己写外链图片语法(``);这一路选择内联,是为了拷走单个 `.md` 也还能带上图。Because the whole animation is inlined on that line: base64 is four characters per three bytes, and the serialisation produces one image tag. For the diffable, readable shape — words in the file, pictures in a folder — write an external reference yourself (``); this route inlines so that a single copied `.md` still carries the picture.
产物长什么样,能给个例子吗?What does the artifact look like — an example?
一行:``。`alt` 与 `title` 都来自你的文件名(去掉扩展名;没有可用名字时是 `converted`),中间是整份动图的 base64 负载。实测就这一行——上一步的 `body` 里只有那张 `<img>`,没有别的正文会被序列化下来。One line: ``. `alt` and `title` both come from your file name (extension dropped; `converted` when there is no usable name), and between the parentheses is the whole animation’s base64 payload. Measured, that single line is the artifact — the previous step’s body holds nothing but that `<img>`, so there is no other prose to serialise.
不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.
从 Chrome 应用商店安装Install from the Chrome Web Store 安装步骤Install steps GitHub 源码Source on GitHub