惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 热门话题
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
AI
AI
B
Blog RSS Feed
S
Schneier on Security
雷峰网
雷峰网
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
罗磊的独立博客
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
The Cloudflare Blog
Webroot Blog
Webroot Blog
Last Week in AI
Last Week in AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
美团技术团队
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
Know Your Adversary
Know Your Adversary
O
OpenAI News
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
I
InfoQ
GbyAI
GbyAI
T
Threatpost
C
Cisco Blogs

Dvel's Blog

Rime 全拼双拼混输 CHD 油猴脚本:每日签到自动答题 Rime 配置:雾凇拼音 Hammerspoon 自动切换输入法 修复 Hugo 本地图片的累计布局偏移(CLS)问题 macOS 利用 Karabiner 修改 Emacs 键位为 Vim 键位 macOS 修改 Emacs 键位为 Vim 键位 Surge 配置 汉字的混乱 Netflix 中英双语字幕的好办法 优化 Rime 英文输入体验 判断字符是否为简体字或繁体字 Cloudflare 转入域名提示「出现了问题。请重试转移此域。尚未向您收费。」 macOS grep + sed 批量替换多个文件的内容 在 macOS 根目录创建文件夹 博客图床小妙招 折腾 Hugo & PaperMod 主题 利用 Cloudflare Workers 进行批量 301 重定向 将博客部署在 Cloudflare Pages Alfred File Navigation(文件导航器)详解 在 Hugo Goldmark Markdown 中设置以新标签打开链接 日期与时间(UTC、GMT、时间戳、时区) 让 Alfred 以新标签的方式打开 Finder 用 git filter-branch 给 Git 仓库瘦身 qBittorrent 设置教程 联通光猫破解+桥接记录 配置 Mac 终端走代理 Steam for Mac 中文游戏推荐 我的 Mac 软件/工具列表 《Flask Web 开发》笔记 用 sleepwatcher 让 Mac 在睡眠及唤醒时自动执行一些脚本 解决 pyenv 导致的 brew warning 《SQL 必知必会》笔记 Git 自总结 Python 异步 IO 笔记 再见,双点医院! 用 CloudXNS 解决 CNAME 与 MX 记录冲突 你好,Hugo! 为 Mac 打造 zsh command line 环境 新 Mac 新装修 秦皇岛暑期自驾的烦恼 苹果公司开发者账号申请流程 UIScrollView 中使用 Masonry 解决 CocoaPods 的类库 import 没有提示 iOS 使用 CocoaPods 的快速回顾 GitBook 简单生成本地静态 HTML 的方法 你好, Hexo! About
图片压缩:Squoosh、TinyPNG、ImageOptim、WebP
Dvel · 2022-01-21 · via Dvel's Blog

一些方便的图片压缩方法:

  • 用 Squoosh 进行格式转换、压缩。

  • 用 TinyPNG 对 JPEG、PNG、WebP 的压缩。

  • 用 ImageOptim 进行本地的 JPEG、PNG 压缩。

  • 用 Google 的 WebP CLI 工具转换为 WebP。(速度最快,推荐)

可以直接在浏览器打开 https://squoosh.app/ 进行压缩,支持即时预览、格式转换和很多参数调节。

也可以用 Squoosh 的 CLI 在本地压缩或转换。

TinyPNG

支持 JPEG、PNG、WebP,压缩效果和 Squoosh 差不太多,但是速度快了很多。

可以直接在浏览器打开 https://tinypng.com/ 上传 - 压缩 - 下载。

点击导航栏的 THIRD-PARTY,下面也有一些第三方的客户端,比如这个 kyleduo/TinyPNG4Mac 就不错。

Compress PNG/JPG

https://www.websiteplanet.com/zh-hans/webtools/imagecompressor/

免费又方便的线上工具,可选三种压缩模式。

ImageOptim

https://imageoptim.com/

ImageOptim 也超棒,提供了 Windows/macOS/Linux 客户端,完全本地操作,但是不支持 WebP。

WebP

WebP 是 Google 于 2010 年 09 月 30 日推出的,同时提供了有损压缩与无损压缩(可逆压缩)的图片文件格式。WebP 的设计目标是在减少文件大小的同时,达到和 JPEG、PNG、GIF 格式相同的图片质量。压缩率很高,10M 的 PNG 图片转换成 WebP 只需要大约 1~2M,而肉眼几乎不可分辨的有损压缩能压到 500KB 左右。

主流浏览器均已支持,2020 年 9 月 Safari 14 也已支持。。。

可在 https://developers.google.com/speed/webp/ 上下载。

macOS 用户可以直接使用 Homebrew 安装,安装完成后即可使用 cwebpdwebpgif2webp 等命令:

  • cwebp:转换/压缩到 WebP
  • dwebp: 将 WebP 转回 PNG
  • gif2webp: GIF 转 WebP
$ brew install webp
...
$ cwebp [options] -q quality input.png -o output.webp
$ dwebp in_file [options] [-o out_file]
$ gif2webp [options] gif_file -o webp_file

默认的压缩率是 75%:

$ cwebp input_file.png -o output_file.webp

可以使用 -q 参数调整压缩质量:

$ cwebp -q 100 input_file.png -o output_file.webp

限定大小(bytes)的有损压缩:

$ cwebp -size 102400 input_file.png -o output_file.webp

WebP 转回 PNG:

$ dwebp in_file [options] [-o out_file]

还有一个 gif2webp 命令,由于 macOS 目前还不支持预览动态 WebP 图片,本地不能直接看到很费劲(只能看到第一帧),动图依然在用 GIF。


也可以写个小脚本,放进 Alfred 里,用起来很方便:

import sys
import os

q = 75

for file in sys.argv[1:]:
    dirname = os.path.dirname(file)
    filename = os.path.splitext(os.path.basename(file))[0]
    file = file.replace(' ', '\\ ',)
    filename = filename.replace(' ', '\\ ')
    os.system(f'cwebp -q {q} {file} -o {dirname}/{filename}.webp')
    sys.stdout.write(f'"{filename}.webp" done.\n')

2022-01-23

GUI 找到一个 isparta,但是两年多没更新了。