convert-image-to-jpg
Skill11 starsChanged 3 months agoMITView on GitHub
Convert local image files from common raster formats into JPG while setting a target DPI (default 96). Use when Codex needs to convert a file or folder of images such as HEIC, HEIF, PNG, TIFF, WebP, BMP, GIF, AVIF, or JPEG into `.jpg` for upload, OCR, archiving, or tools that require JPEG output.
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-paper-downloadSkill
- airnow-hourly-obs-fetchSkill
- ai-tech-fulltext-fetchSkill
- ai-tech-rss-fetchSkill
- ai-tech-summarySkill
- apply-environmental-thinkingSkill
- bluesky-cascade-fetchSkill
- dify-knowledge-base-searchSkill
- dify-knowledge-base-uploadSkill
- document-granular-decomposeSkill
- domain-onboardingSkill
- eceee-news-fulltext-fetchSkill
- email-imap-appendSkill
- email-imap-fetchSkill
- email-imap-full-fetchSkill
- email-smtp-sendSkill
- epa-eis-records-fetchSkill
- federal-register-doc-fetchSkill
- fetch-abstract-to-kbSkill
- fetch-meta-from-kbSkill
- fetch-meta-to-kbSkill
- figshare-data-downloadSkill
- gdelt-doc-searchSkill
- gdelt-events-fetchSkill
- gdelt-gkg-fetchSkill
- gdelt-mentions-fetchSkill
- gdelt-web-ngrams-searchSkill
- github-contribution-period-analysisSkill
- nasa-firms-fire-fetchSkill
- notebooklmSkill
- openaq-data-fetchSkill
- open-meteo-air-quality-fetchSkill
- open-meteo-flood-fetchSkill
- open-meteo-historical-fetchSkill
- regulationsgov-attachments-fetchSkill
- regulationsgov-comment-detail-fetchSkill
- regulationsgov-comments-fetchSkill
- remove-similar-imageSkill
- river-outfall-status-visualizerSkill
- sustainability-fulltext-fetchSkill
- sustainability-rss-fetchSkill
- sustainability-summarySkill
- synology-file-stationSkill
- tiangong-auto-researchSkill
- tiangong-auto-research-workbuddySkill
- tiangong-kb-course-fulltext-fetchSkill
- tiangong-kb-course-searchSkill
- tiangong-kb-edu-searchSkill
- tiangong-kb-esg-searchSkill
- tiangong-kb-ingestSkill
- tiangong-kb-patent-searchSkill
- tiangong-kb-report-searchSkill
- tiangong-kb-sci-searchSkill
- tiangong-kb-textbook-searchSkill
- tsinghua-graduate-thesisSkill
- usbr-project-records-fetchSkill
- usbr-rise-fetchSkill
- use-thuenv-presentation-styleSkill
- usgs-water-iv-fetchSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Write JPG DPI metadata as 96 by default or a caller-provided value.
- Very specific: line 16
Prefer magick when it is installed.
- Distinctive: line 18
Stop and report the missing dependency when neither backend exists.
- Distinctive: line 57
Treat directory input as recursive and keep the same relative subdirectories in the output tree.
- Very specific: line 58
Treat single-file --output-path as a directory when it has no .jpg or .jpeg suffix.
- Very specific: line 60
Default JPG quality to 95.
- Distinctive: line 61
Use the first frame or page when the source format can contain multiple frames, such as GIF or TIFF.
- Very specific: line 63
Add uncommon extensions with --extra-extension .ext when needed.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Convert Image to JPG
Core Goal
- Convert one local image or a directory tree of local images into
.jpg. - Write JPG DPI metadata as
96by default or a caller-provided value. - Preserve relative directory structure when the input path is a directory.
Required Tools
- Use
scripts/convert_to_jpg.py. - Rely only on Python standard library modules. Do not install Python packages for this skill.
- Prefer
magickwhen it is installed. - Fall back to macOS
sipswhenmagickis unavailable. - Stop and report the missing dependency when neither backend exists.
Quick Start
- Convert one file to a specific JPG path:
python3 scripts/convert_to_jpg.py \
--input-path /path/to/image.heic \
--output-path /path/to/output.jpg- Convert a directory recursively with custom DPI:
python3 scripts/convert_to_jpg.py \
--input-path /path/to/input-images \
--output-path /path/to/output-images \
--dpi 300- Rewrite existing outputs in place or replace previous runs:
python3 scripts/convert_to_jpg.py \
--input-path /path/to/input-images \
--output-path /path/to/output-images \
--overwrite- Preview the conversion plan without writing files:
python3 scripts/convert_to_jpg.py \
--input-path /path/to/input-images \
--output-path /path/to/output-images \
--dry-runBehavior
- Treat directory input as recursive and keep the same relative subdirectories in the output tree.
- Treat single-file
--output-pathas a directory when it has no.jpgor.jpegsuffix. - Convert
.jpgand.jpeginputs too. Use this to normalize output names or rewrite DPI metadata. - Default JPG quality to
95. - Use the first frame or page when the source format can contain multiple frames, such as GIF or TIFF.
- Refuse ambiguous directory conversions when two source files would map to the same destination
.jpg. - Add uncommon extensions with
--extra-extension .extwhen needed.
Main Arguments
--input-path: source file or source directory--output-path: output JPG file path or output directory--dpi: target DPI metadata for the JPG output, default96--quality: JPG quality from1to100, default95--backend:auto,magick, orsips--extra-extension: additional directory-scan suffix to include--overwrite: replace existing outputs--dry-run: print the plan without converting files--limit: cap the number of files processed during a quick check
Script
scripts/convert_to_jpg.py
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

