0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PNG 形式の画像を WebP の base64 に変換

Last updated at Posted at 2025-02-28
# PNG -> WebP -> base64
./convert.sh <PNG FILE PATH>

# クリップボードにコピー
cat xxx.txt| pbcopy
convert.sh
#!/usr/bin/env bash

origImage="$1"
name=$(basename "$origImage" .png)

# https://developers.google.com/speed/webp/docs/cwebp
cwebp "${origImage}" -mt -quiet -hint picture -o "${name}".webp
base64 -i "${name}".webp -o "${name}".txt
rm -rf "${name}".webp
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?