raycast / raycast/extensions

[Image Modification] Add Sharp as a local image-optimization backend

Open
#30,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.8k
Forks
6.9k
Avg merge
2d 6h
Merged PRs (30d)
442

Description

Summary

add Sharp as a local backend for the existing Optimize Images command

Current behavior

Image Modification currently uses several format-specific paths:

  • JPEG: NSBitmapImageRep through AppleScript
  • PNG: bundled PNGOUT binary
  • WebP: bundled cwebp
  • AVIF: avifenc/avifdec
  • SVG: SVGO

Proposal

Sharp could improve Image Modification’s common raster operations by replacing several disconnected AppleScript, SIPS and command-line pipelines with one local processing API. JPEG, PNG, WebP and AVIF images could be decoded, transformed and encoded directly without temporary JPEG or PNG round trips.
Sharp also provides explicit quality, lossless, effort, progressive-encoding, palette-quantization and metadata controls, while eliminating manually selected WebP binaries and the external libavif installation.

SVGO, Core Image, Vision, ExifTool, PDFKit, Potrace and SIPS would continue to handle features Sharp doesn't. Compression results could benfit from benchmarking because while Sharp is architecturally simple, I don't know if it would perform better on the all the various images it could be configured for.

Metadata and timestamps

Sharp strips metadata by default, so the behavior should be explicit:

  • Allow embedded metadata, including EXIF/GPS, to be preserved
  • Keep Strip EXIF Data as a separate intentional action
  • Preserve the original filesystem modification date when replacing a file
  • Document whether the macOS creation date can also be restored reliably

Selective removal of only GPS metadata could be handled separately through the extension’s existing ExifTool support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing Image Modification “Optimize Images” command and its JPEG, PNG, WebP, and AVIF processing paths. Evaluate how a local Sharp backend could fit alongside SVGO, Core Image, Vision, ExifTool, PDFKit, Potrace, and SIPS, then benchmark representative images. Done should include explicit metadata and timestamp behavior plus documented scope for features Sharp does not replace.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.