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

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

WebP 转 HTML——离线、字节原样内嵌、透明不动WebP to HTML offline — bytes verbatim, alpha intact

这条路是搬运:`webp>html` 用 `FileReader.readAsDataURL` 把文件的原始字节编成 data URI 写进一个 `<img src>`,再包进自带样式表的 HTML,中间**没有解码、没有画布、没有重编码**。对 WebP 而言有两件正因为此而成立。一是**透明不动**:WebP 带 alpha,而这条链不重新采样,所以那层透明原样进负载——反倒是 WebP→JPG 那种要过画布的路线会把它合成掉。二是**动画数据在**:动图 WebP 的每一帧都在文件里,这一路不做取帧这一步。但这里要把话说到底:本扩展目前**只对 GIF 数过帧**(`utils/core/animated-image.ts` 的说明写得很清楚——动图 WebP 的 `VP8X` ANIM 位与 APNG 的 `acTL` 都在它的量测范围之外),所以走 WebP→PNG / JPG 那几类会取首帧的路线时,**丢了几个动画不会有人告诉你**。这条限制在这里写明,不藏进实现细节里;至于播放,仍然归打开这份 HTML 的那一侧决定,本页不替它承诺。其余与位图转网页同形:`alt` 与 `title` 取**文件名主干**(去扩展名、无名时 `converted`)并按属性位置转义;内层 CSS 居中、`max-width: 100%`,版心实测约 800 px,宽图显示收、文件不动;体积是每三个字节四字符再加约 2.6 KB 外壳(随文件名长度增减)。`data:image/webp` 在剥远程引用的白名单内,**前提是类型被浏览器认出**:从 ZIP 解包出来的文件不带类型,前缀会是 `application/octet-stream`,那种情况下往 Word 走一步会被剥掉 `src`。This route carries: `webp>html` encodes the file’s raw bytes with `FileReader.readAsDataURL` into a data URI inside one `<img src>` and wraps it in a document with the bundled stylesheet — **no decode, no canvas, no re-encode**. For a WebP two things follow. Alpha survives: the format carries transparency and this chain never resamples it, whereas routes that pass over a canvas (WebP to JPG, say) composite it away. And the animation survives as data: every frame of an animated WebP is inside the file and this route takes no frame-selection step. Finish the sentence honestly, though: this extension currently counts frames **for GIF only** — the note in `utils/core/animated-image.ts` puts animated WebP’s `VP8X` ANIM flag and APNG’s `acTL` chunk outside what it measures — so if you take a route that keeps the first frame, **nobody tells you how many frames of animation went missing**. That limit belongs on the page, not buried in the implementation. Playback, as elsewhere, is decided by whatever opens the HTML, and this page makes no promise for it. Everything else matches the other pictures-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; the size is four characters per three bytes plus a wrapper of about 2.6 KB that grows with the file name. `data:image/webp` is inside the reference allow-list **provided the browser recognised the type** — a file unpacked from a ZIP carries none, so its prefix is `application/octet-stream` and one more step toward Word would strip the `src`.

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

这条链路怎么走How the route runs

WebPWebP HTMLHTML

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

会保留什么What carries over

  • 透明通道原样保留:这条链不重新采样,也不把 alpha 合成掉Alpha stays as it is: this chain never resamples and never composites the transparency away
  • 动画数据不缺帧:没有取首帧这一步,整份文件进负载(丢帧披露目前只覆盖 GIF)The animation is not reduced to one frame — there is no first-frame step, the file goes in whole (frame-loss disclosure currently covers GIF only)
  • `alt` 与 `title` 取文件名的主干(去扩展名),并按属性位置转义`alt` and `title` carry the file’s basename with the extension dropped, escaped for attribute position
  • 自包含:图就在文件里,打开这份 HTML 不取任何远程资源Self-contained: the picture is in the file, and opening it fetches no remote resource
  • 一批最多 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 promised: the frame data is all there, but playback and looping belong to whatever opens the page
  • WebP→PNG / JPG 那几路会取首帧;而「只保留第一帧」的提示是固定一句、不报帧数,且这项检查目前只覆盖 GIF,动图 WebP 走那几路连这句提示都没有WebP to PNG or JPG keeps the first frame — and because the frame check covers GIF only, an animated WebP loses its frames with no notice at all, let alone a count
  • 体积只增不减:每三字节四字符再加约 2.6 KB 外壳,这一路不是压缩The file only grows: four characters per three bytes plus about 2.6 KB of wrapper, so this is not compression
  • 不降尺寸、不裁切、不改格式:那些开关在图片转图片那几页No downscale, no crop, no format change: those controls live on the image-to-image pages
  • 类型没被浏览器认出时(例如从 ZIP 解包)前缀不是 `image/webp`,再往 Word 走一步会被剥掉 `src`When the browser never identified the type — a file unpacked from a ZIP — the prefix is not `image/webp`, and one step toward Word strips the `src`

实操提示Working with it

  • 要 Markdown 里的图:WebP→Markdown 就是这条再加一步序列化For a picture in Markdown: WebP to Markdown is this step plus a serialisation
  • 要真的变小或换格式:WebP→JPG 会过画布并把透明合成到白底;WebP→PNG 也过画布,但那条不铺白底,透明留下、只剩首帧To actually shrink or reformat: WebP to JPG passes over a canvas and composites the transparency onto white, while WebP to PNG also uses the canvas but fills no ground — alpha stays, the animation does not
  • 要固定像素尺寸:图片转图片那几页才有最长边与质量开关For a fixed pixel size: the image-to-image pages are where the longest-edge and quality knobs live

常见问题Questions people actually ask

我的动图 WebP 转成 HTML 还会动吗?Will my animated WebP still animate once it is HTML?

这一路能保证的是**没有减帧**:文件字节原样进负载,没有取首帧、也没有重编码。播不播、循环几次,由打开这份 HTML 的浏览器或宿主页面决定,本页不替它承诺。另外提醒一句:如果你改走需要重编码的路线(WebP→PNG / JPG),那里确实只剩一帧,而**当前界面不会告诉你丢了几个动画**——帧检查现在只覆盖 GIF。What this route guarantees is that no frames were removed: the bytes go in verbatim, with no first-frame grab and no re-encoding. Whether it plays and how often it loops is up to the browser or host document that opens the page, and nothing here promises that for them. One warning alongside it: switch to a route that must re-encode (WebP to PNG or JPG) and only one frame survives — and today the interface **will not tell you how many frames of animation went missing**, because the frame check covers GIF only.

WebP 的透明背景会保住吗?Does my WebP’s transparent background survive?

这条会,因为它根本不碰像素。反过来,WebP→JPG 那一路是画到画布上再编码的,JPG 也没有透明通道,所以那一趟会把 alpha 合成掉。要「透明 + 位图」就留在 PNG 侧,要「透明 + 网页」这一路最省事。Here it does, precisely because no pixels are touched. WebP to JPG draws onto a canvas before encoding, and JPEG has no alpha channel, so that trip composites the transparency away. Want transparency as a bitmap: stay on the PNG side; want transparency in a web page: this is the cheapest route.

为什么不干脆转成 PNG?Why not just convert it to PNG?

因为两者给的东西不同。转 PNG 是一次重编码:单帧、静态、可以被任何收图片的地方接受,体积通常也会变。走 HTML 是搬运:所有帧都在、alpha 不动,代价是交付的不是图片文件而是一个网页,并且体积按 base64 上浮。交付物必须是「一张图」时才选前者。They hand over different things. Converting to PNG is a re-encode: one frame, static, accepted wherever a picture file is required, and usually smaller. This route is carrying: every frame and the alpha stay, at the cost of delivering a web page instead of an image file, plus base64 growth. Choose PNG only when what the receiving side needs is a picture.

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