图片压缩1m以下

SKILL前端设计
前端设计 未标注权限 许可证不明确
安装这个技能

Shrink JPEG images below a target file size (1 MB by default) while keeping the picture itself unchanged, for upload limits, email attachments, and form submissions. Handles single files and whole directory trees, preserves the visible framing and colour, and never touches the originals. Use when the user asks to compress or shrink an image, make a photo smaller, reduce file size, get images under 1MB/2MB/5MB, or prepare photos for a site that rejects oversized uploads. Chinese triggers - 图片压缩、压缩图片、图片太大、缩小图片体积、图片瘦身、把图片压到1M以下、图片超过上传限制、批量压缩图片.

一句话选型结论

按资料字段整理

图片压缩1m以下是前端设计类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类前端设计 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_fe0315bc/xiao
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

前端设计
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_fe0315bc仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791625128
正文体量9.0 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
出页面与组件

按描述生成页面结构和组件草稿。

调整样式与布局

改间距、配色与响应式布局。

生成设计说明

把设计稿整理成开发能接的说明。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在前端设计场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
图片压缩1m以下当前 未标注权限 未标注 未标注 未标注 有
前端设计 只读 GitHub 仓库 882.3 万 Codex、Claude、Cursor 有
Vercel 组合模式 联网访问 GitHub 仓库 385.9 万 Codex、Claude、Cursor 有
Vercel React native skills 前端 只读 GitHub 仓库 246.9 万 Codex、Claude、Cursor 有
adapt 搜索 浏览器控制 GitHub 仓库 202.7 万 Codex、Claude、Cursor 有
使用我的浏览器 浏览器控制 GitHub 仓库 184.8 万 Codex、Claude、Cursor 有

SKILL.md 全文

9.0 KB
模型实际读到的说明书原文,来自技能仓库

Image Compression To A Target Size

Fit JPEG images under a size ceiling (1 MB by default) by trading away JPEG
quality first and resolution only as a last resort. The picture the viewer sees
stays the same: same subject, same framing, same aspect ratio, same colours.
Originals are never overwritten — results land in a compressed/ folder.

When To Use

  • The user wants an image reduced in file size: 压缩图片, 图片太大, 缩小体积, 压到 1M 以下.
  • An upload or form rejects a file for being too large.
  • A batch of photos needs to be made upload-ready at once.

When Not To Use

  • The request is about image generation, editing, retouching, background
    removal, or watermark removal — that is a different tool.
  • The user wants a different format, a crop, or a creative re-frame. This skill
    deliberately only changes encoding, never composition.
  • The input is not a JPEG. The script reports non-JPEG inputs as skipped — see
    "When The Input Is A PNG" below for how to handle those deliberately.

Running It

The script lives at scripts/compress_jpeg.py inside this skill directory.

# One file - default 1 MB ceiling
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/path/photo.jpg"

# Several files
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/a.jpg" "/abs/b.jpg"

# A whole tree, recursing into subfolders
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/path/to/folder"

# A different ceiling, default 1 MB
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/photo.jpg" --target-mb 2

# Certificates, scans, screenshots - keep coloured text and seals sharp
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/certs" --subsampling 0

# Machine-readable summary for further processing
python3 <SKILL_DIR>/scripts/compress_jpeg.py "/abs/folder" --json /tmp/result.json

Results go to a compressed/ subfolder beside each input, mirroring the
subfolder layout when a directory is passed. Pass --output-dir NAME to rename
that folder.

Options

Flag Default Meaning
--target-mb N 1.0 Size ceiling in decimal MB
--output-dir NAME compressed Result subfolder name
--min-quality N 40 Lowest quality tried before falling back to downscaling
--min-dimension N 640 Long-edge floor in pixels when downscaling
--subsampling N 2 0=4:4:4, 1=4:2:2, 2=4:2:0
--progressive off Progressive JPEG; better on slow links but ~4% larger
--strip-metadata off Drop EXIF/ICC for extra savings
--include-ok off Copy files that already fit, instead of skipping them
--json PATH – Write a machine-readable summary
--quiet off Print only the summary line

Exit code is 0 when every file reached the target and 1 when at least one
failed.

How "Unchanged" Is Guaranteed

Two details matter and are easy to get wrong:

  1. The ceiling carries a 2% safety margin. A "1 MB" limit is ambiguous —
    some consumers mean 1,000,000 bytes, others 1,048,576. Results are held to
    98% of the stated target so the file clears either reading.
  2. EXIF orientation is baked into the pixels before anything else happens.
    A portrait iPhone photo stores landscape pixels plus a "rotate me" flag.
    Re-encoding tools that drop the flag silently turn the picture sideways —
    and macOS sips does exactly that as soon as it resizes. The script applies
    the orientation to the pixels up front, so a portrait photo stays portrait.
    Verify this on any change to the imaging code.

A 12 MP photo typically lands at quality ~90 with the original pixel dimensions
intact. Downscaling only kicks in when quality alone cannot reach the target.

The quality search runs from --min-quality up to 100, then takes the
highest level that still fits. When an image has size to spare the extra budget
goes into fidelity rather than being thrown away.

Documents, Screenshots And Certificates

Pass --subsampling 0 for anything whose value is fine text or a seal: scanned
documents, certificates, screenshots, forms. The default 4:2:0 halves colour
resolution, which smears the coloured edges of red text and official stamps.

Measured on a 1179x1667 training certificate (source was q100 4:4:4, 1.02 MB)
against a 1 MB ceiling:

Setting Result PSNR
--subsampling 2 (default) 0.35 MB, q≈95 44.8 dB
--subsampling 0 0.85 MB, q=99 53.9 dB

Both fit the ceiling, so the 4:2:0 run simply gave away 9 dB of fidelity for
space nobody asked for. For photographs the default remains the right trade.

When The Input Is A PNG

The script walks past PNGs, so handle them deliberately rather than assuming a
format conversion is free. Measure before choosing — the right answer depends
entirely on how much fine texture the picture carries.

Worked example, a 4.97 MB screenshot of a certificate at 2686x1870 with 17,674
distinct colours (woven paper texture behind the text):

Attempt Result
PNG re-save, lossless optimize 4.59 MB — nearly no gain
PNG palette, 256 colours 2.41 MB — still over
PNG palette, 128 colours 2.16 MB — still over
JPEG 4:4:4 q90 at full resolution 1.52 MB — still over
JPEG 4:4:4 q80 at full resolution 0.95 MB — fits, but text softens
JPEG 4:4:4 q92 at 1800 px 0.80 MB — fits, text stays crisp
PNG palette 256 at 1400 px 0.86 MB — fits, keeps .png, visibly softer

The texture is what blocks every lossless route, so the choice reduces to
"lower quality at full size" versus "slightly smaller pixels at high quality".
For text the second wins clearly: compare both at the same on-screen size
before deciding, and tell the user which one you picked and why.

Two things to flag to the user in this case: converting to JPEG changes the file
extension, so confirm the destination accepts it; and a downsized page is a real
change in resolution even though the wording and layout are untouched.

Environment

Requires Python 3.9+ and Pillow. Nothing else — no imagemagick, no
jpegoptim, no network access.

The script bootstraps itself: if the interpreter you launched it with lacks
Pillow, it probes, in order, WorkBuddy-managed virtualenvs, managed runtimes,
and python3 on PATH, then re-executes under the first one that has Pillow.
No path to any user's home directory is baked in, so the same file works after
being copied to another machine.

When editing that bootstrap, keep candidate paths as found and never call
realpath() on them. A virtualenv's bin/python is a symlink onto its base
interpreter; resolving it and running the target silently leaves the
virtualenv, so its site-packages — and Pillow — disappear. Deduplicate on the
literal path instead.

If none of them has Pillow, install it once:

python3 -m pip install Pillow

The default PyPI index is sometimes unreachable behind a corporate network.
If the install hangs or reports No matching distribution found, pass a mirror
explicitly:

python3 -m pip install \
  --index-url https://pypi.tuna.tsinghua.edu.cn/simple Pillow

Use an isolated environment rather than the system Python, so the install does
not disturb anything else:

python3 -m venv ~/.venvs/imgcompress
~/.venvs/imgcompress/bin/pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple Pillow
~/.venvs/imgcompress/bin/python <SKILL_DIR>/scripts/compress_jpeg.py "/abs/photo.jpg"

Verify a transplant with a one-liner before trusting it on real work:

python3 -c "import PIL; print('Pillow', PIL.__version__)"

Reporting Back

Relay the real numbers from the run rather than a generic success message:

  • original size → final size and the percentage saved,
  • the quality level used,
  • whether the pixel dimensions were reduced,
  • anything that failed, with its actual error.

Present the produced files so the user can inspect them.

Reading The Summary

  • OK — compressed to within the target.
  • COPY — already compliant, copied byte-for-byte (--include-ok only).
  • SKIP — already compliant and left alone, or not a JPEG.
  • FAIL — could not be brought under the target, or the file is corrupt. The
    reason is printed; report it instead of retrying blindly.

Files already under the ceiling are still opened and validated, so a truncated
or corrupt JPEG is reported as FAIL rather than waved through.

常见问题

5 问
答案由本站依据条目字段整理
图片压缩1m以下怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_fe0315bc/xiao。安装方式为未标注。装完刷新技能列表或重开客户端。

图片压缩1m以下支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

图片压缩1m以下权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

图片压缩1m以下收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

图片压缩1m以下用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。