文件格式任意转换助手Transfer Any File

离线 · 无上传 · 浏览器本地完成Offline · no uploads · runs in the browser

GIF 转 HTML——离线、字节原样内嵌、不丢帧GIF to HTML offline — every frame stays in the file

这条路和图片转 HTML 的其他几位共用同一个转换器,而且刻意做得很薄:`gif>html` 把文件的**原始字节**用 `FileReader.readAsDataURL` 编成 data URI 写进一个 `<img src>`,再包进一份自带样式表的 HTML——**中间没有任何解码、上画布或重编码**。对 GIF 来说这一点正好是要害:动图的全部帧都还在那串字节里,**这一路不丢帧**,因为要丢帧得先读帧、而这条链连像素都不看。对照之下 GIF→PNG / JPG / WebP / PDF 那几路确实丢:它们取首帧重编码,并且会动用 `hasMultipleFrames` 在结果上固定提示只保留第一帧——那才是需要披露丢帧的地方。要说清的边界是**播放由谁决定**:字节完整不等于一定动起来,是否播放、循环几遍,是打开这份 HTML 的那一侧的事,本扩展不替它保证。其余与位图转网页同形:`alt` 与 `title` 取**文件名主干**(去扩展名、无名时 `converted`)并按属性位置转义;内层 CSS 让图居中、`max-width: 100%`,版心实测约 800 px,所以宽图显示会收、文件里的一个像素都不变;体积是每三个字节写成四个字符再加约 2.6 KB 外壳(界面上 2 MB 的 GIF 约产出 2.7 MB 的 HTML),这一路不是压缩。`data:image/gif` 在剥远程引用的白名单之内,所以这份 HTML 再往下走一步(转 Markdown、转 Word)通常也不会被剥掉——前提是类型被浏览器认出;从 ZIP 解包出来的文件没有类型,前缀就不是 `image/gif`,Word 那一步会先把 `src` 剥掉——它不外发任何东西,扩展本身也只有 storage 权限。This route shares one converter with the other pictures-to-HTML pages, and it is deliberately thin: `gif>html` takes the file’s **raw bytes**, base64-encodes them through `FileReader.readAsDataURL` into a data URI inside an `<img src>`, and wraps that in a document with the bundled stylesheet — **no decode, no canvas, no re-encode anywhere**. For a GIF that is the whole point: every frame is still inside those bytes, so **this route drops none**, because dropping frames would mean reading them and this chain never looks at pixels. The contrast is real: GIF to PNG, JPG, WebP or PDF does take the first frame and re-encodes it, and those routes use `hasMultipleFrames` to show a fixed notice that only the first frame survives — that is where the frame-loss disclosure lives. The boundary to state plainly is **who decides playback**: intact bytes do not guarantee motion, since whether it animates and how many times it loops belongs to whatever opens the file, and this extension promises nothing on their behalf. Everything else matches the other picture-to-HTML pages: `alt` and `title` carry the **basename** (extension dropped, `converted` when there is no usable name) escaped for attribute position; the inner CSS centres the image and caps it at `max-width: 100%` within a measure measured at about 800 px, so a wide picture scales on screen while the file stays untouched; the size is four characters per three bytes plus a wrapper of about 2.6 KB, so the 2 MB GIF the interface shows comes out as roughly 2.7 MB of HTML — this is not compression. And because `data:image/gif` is inside the allow-list that keeps references from reaching the network, taking one more step (to Markdown, to Word) does not strip the picture either — provided the browser recognised the type, since a file unpacked from a ZIP has none, and its prefix is not `image/gif`, which the Word step does strip. Nothing is ever sent out; the extension holds only the storage permission.

一批转换结果卡片,含文件名、体积与下载入口
一次混合批量,一个 ZIP 下载One mixed batch, one ZIP download

这条链路怎么走How the route runs

GIFGIF HTMLHTML

共 1 步,由扩展的路径搜索自动选出,中间产物不落盘。1 step, chosen by the extension's own path search; intermediate results never touch the disk.

会保留什么What carries over

  • 一帧都不丢:不解码、不上画布、不再压一次,整份动图原样进 `data:` 负载Not one frame lost: no decode, no canvas, no re-compression — the whole animation goes into the `data:` payload
  • `alt` 与 `title` 取文件名的主干(去扩展名),并按属性位置转义——名字不会变成标记`alt` and `title` carry the file’s basename with the extension dropped, escaped for attribute position so a name cannot become markup
  • 自包含:图就在文件里,打开这份 HTML 不取任何远程资源Self-contained: the picture is in the file, and opening it fetches no remote resource
  • `data:image/gif` 在引用白名单内,类型被浏览器认出时再往下一步转 Markdown / Word 也不会被剥掉`data:image/gif` is inside the reference allow-list, so a further step to Markdown or Word keeps it too — provided the browser recognised the type
  • 一批最多 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

  • 不保证会动:字节完整是一回事,播放与循环次数由打开这份 HTML 的那一侧决定,本扩展不替它承诺Motion is not guaranteed: intact bytes are one thing, playback and loop counts belong to whatever opens the page, and this extension makes no promise for it
  • 不读内容也不做 OCR:产物里唯一的字符串来自你的文件名,图里印着什么这条链一概不知道No OCR and no invented description: the only string in the output comes from your file name
  • 体积只增不减:每三字节四字符再加约 2.6 KB 外壳(2 MB 的 GIF 约产出 2.7 MB HTML),不适合当压缩The file only grows: four characters per three bytes plus about 2.6 KB of wrapper, so a 2 MB GIF becomes roughly 2.7 MB of HTML — this is not compression
  • 不改尺寸、不选帧、不裁切:想要这些请走图片转图片那几页,那里才有尺寸与质量开关No resizing, no frame picking, no cropping: take the image-to-image pages, where the size and quality controls live
  • 只包一张图:多张图请一个文件一次,或自己先拼成一张(本扩展不提供拼图功能)One picture per file: convert several one at a time, or tile them yourself first — this extension has no collage or tile feature

实操提示Working with it

  • 要 Markdown 里的图:GIF→Markdown 就是这条再加一步序列化For a picture in Markdown: GIF to Markdown is this step plus a serialisation
  • 要 Word 文档里的图:GIF→Word 再走 `html>docx`,那条 data URI 会换成包里的图片部件For a picture in a Word file: GIF to Word adds `html>docx`, which turns that data URI into an image part inside the package
  • 要真的换格式或降尺寸:那需要重编码,也就必然只剩首帧,请走图片转图片那几页To really change format or shrink it: that needs re-encoding, which means the first frame only, so take the image-to-image pages

常见问题Questions people actually ask

GIF 转成 HTML 之后还会动吗?Will my GIF still animate once it is HTML?

这条能保证的是「帧都还在」:文件字节原样内嵌,没有取首帧、没有重编码,所以动图的数据一个字节都没少。至于播不播、循环几遍,是打开这份 HTML 的那一侧(浏览器或宿主页面)决定的,本页不替它承诺——这也是为什么把 GIF 交给只收 PNG / JPG 的地方那是你在本工具之外又多丢一次帧的一步。What this route guarantees is that all frames survive: the file’s bytes go in verbatim, with no first-frame grab and no re-encoding, so nothing is subtracted from the animation. Whether it plays and how often it loops is decided by whatever opens the page — a browser or a host document — and this page makes no promise for them. That is also why handing a GIF to something that only accepts PNG or JPEG is where frames get lost a second time, outside this tool.

为什么产物比原文件大?Why is the output bigger than my file?

base64 每三个字节要写成四个字符,这是编码形态的固定开销;另加约 2.6 KB 的文档外壳(`<style>` 里那份 CSS 与标签,它随文件名长度略有增减)。想变小请走图片转图片那几路做真实重编码——只是那条路必然取首帧。base64 writes every three bytes as four characters — the fixed cost of the encoding — plus a document wrapper of about 2.6 KB (the CSS in `<style>` and the markup, which moves a little with the length of your file name). To go smaller, take an image-to-image route and re-encode for real — accepting that it keeps the first frame only.

这跟我把 GIF 用 `<img>` 标签引到网页里有什么区别?How is this different from just pointing an `<img>` at my GIF?

引用方式不同:外链要图另存在某个地方,别人只拿这份 HTML 就看不到;这里是内嵌,图随文件走,拷走单个 HTML 就能显示。它也不会在你双击打开时发起任何请求——`data:image/gif` 属于被允许留下的引用类型,后续再转 Markdown 或 Word 也不会被剥掉。The reference is different: an external link needs the picture stored somewhere, and anyone who takes only the HTML sees nothing; here the picture travels inside the file, so a single copied page still shows it. It also issues no request when you double-click it — `data:image/gif` is one of the reference types allowed to survive, so a later step to Markdown or Word keeps it too.

不需要账号,也不需要联网:装好扩展后点图标,在新标签页里打开工作台,文件从磁盘直接选。No account and no network: install the extension, click its icon, and the workbench opens in a new tab reading straight off your disk.