Skip to main content

image-optimize

Shrink images with ImageMagick into a new file and leave the original in place. Use before an upload or an attachment.

소스 정보

저장소
oidsdev/honeypot
최근 소스 활동
2026년 10월 9일 14:25
감지된 SKILL.md 언어
영어
스타
0
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
image-optimize
description
Shrink images with ImageMagick into a new file and leave the original in place. Use before an upload or an attachment.
# Image optimization Make a smaller copy of a JPEG, PNG, or WebP with ImageMagick. The original file stays where it is. ## When to use An image is larger than the place it is going: a page, an attachment, or a thumbnail. Resize it, drop the metadata, and write a new file. Compare the two before you replace anything. ## Install ImageMagick 7 installs the `magick` command. ImageMagick 6 installs `convert`. Use whichever one exists. ```sh magick -version || convert -version ``` ```sh # Debian / Ubuntu sudo apt-get install imagemagick # macOS brew install imagemagick ``` Pick the binary once and reuse it: ```sh if command -v magick >/dev/null; then IM=magick; else IM=convert; fi ``` ## Commands Shrink a photo so the longest side is at most 1600 pixels, bake in the orientation, strip metadata, and write a JPEG. The `>` suffix means "only shrink". Quote it so the shell does not treat it as a redirect. ```sh "$IM" input.jpg -auto-orient -resize '1600x1600>' -quality 82 -strip output.jpg ``` PNG, still a new file. `-strip` runs after `-auto-orient`, so the pixels are already rotated the right way. ```sh "$IM" input.png -auto-orient -resize '1600x1600>' -strip output.png ``` WebP from the same source: ```sh "$IM" input.png -auto-orient -resize '1600x1600>' -quality 80 -strip output.webp ``` Look at dimensions and byte sizes before you keep the result. ```sh identify input.jpg output.jpg ls -l input.jpg output.jpg ``` ## Gotchas - `mogrify` writes over the file you name. These examples use `magick` or `convert` so the original stays put. - `-strip` removes profiles, comments, and EXIF, including GPS. Run `-auto-orient` first, or a phone photo can come out sideways. - An unquoted `1600x1600>` is a shell redirect. Keep the quotes. - Quality `82` is a reasonable JPEG. Lower numbers get smaller and softer. Look at the output before you go further down. - A file that is already small can grow when you change format. Keep the original when `ls` shows the new file is larger. --- Also on Honeypot — a free, open index of skills for AI agents: https://honeypot-e6c.pages.dev [![Indexed on Honeypot](https://honeypot-e6c.pages.dev/badge.svg)](https://honeypot-e6c.pages.dev)
GitHub에서 보기