[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81631":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},81631,"rastermill","openclaw\u002Frastermill","openclaw","Fast, portable image processing for Node agents.","https:\u002F\u002Frastermill.com",null,"TypeScript",31,1,2,0,3,9,49.3,"MIT License",false,"main",true,[],"2026-06-12 04:01:34","# Rastermill\n\n![Rastermill banner](docs\u002Fassets\u002Freadme-banner.jpg)\n\nFast, portable image processing for Node agents.\n\nRastermill provides a small image-processing API for server-side Node code. It uses\nPhoton for fast in-process image work and can fall back to native tools such as\n`sips`, ImageMagick, GraphicsMagick, or ffmpeg for formats that need external\ncodec support.\n\nDocs: \u003Chttps:\u002F\u002Frastermill.com\u002F>\n\n```ts\nimport { createRastermill } from \"rastermill\";\n\nconst rastermill = createRastermill({\n  execution: \"auto\",\n  limits: {\n    inputPixels: 25_000_000,\n    outputPixels: 25_000_000,\n  },\n});\n\nconst info = await rastermill.probe(imageBuffer);\nconst jpeg = await rastermill.encode(imageBuffer, {\n  format: \"jpeg\",\n  resize: { maxSide: 1600 },\n  quality: 85,\n});\n\u002F\u002F => { data, format: \"jpeg\", mimeType: \"image\u002Fjpeg\", width, height, bytes, metadata: \"stripped\", resized, chosen }\n```\n\n## API\n\n```ts\nconst rastermill = createRastermill(options);\n```\n\nThe API is three methods:\n\n- `probe(input)` — read `format`, `width`, `height`, `bytes`, `hasAlpha`, and `orientation` from the header, without a full decode.\n- `transparency(input)` — decode common raster formats and report `hasAlphaChannel` separately from `hasTransparentPixels`.\n- `encode(input, options?)` — resize, re-encode to an exact format, auto-select opaque vs transparent output, fit dimension limits, and\u002For search a byte budget.\n\nThe same methods are also exported as standalone functions backed by a lazy\ndefault-configured instance:\n\n```ts\nimport { probe, transparency, encode } from \"rastermill\";\n```\n\nA straight format conversion (e.g. HEIC\u002FAVIF → JPEG) is just `encode(input, { format: \"jpeg\" })` with no `resize`. JPEG EXIF orientation is baked in by default; HEIC orientation handling depends on the native backend. Pass `autoOrient: false` to skip explicit orientation work.\n\nEncoded outputs strip metadata by default. `metadata: \"preserve\"` only preserves\nmetadata when Rastermill can return the original bytes unchanged; Photon does not\nexpose EXIF\u002FGPS\u002FICC\u002FXMP read, write, or copy APIs, so any real transform strips\nmetadata and reports `metadata: \"stripped\"`.\n\n## Backends\n\n`execution: \"auto\"` uses Photon in-process for supported formats, then native\ntools when a format needs external codec support. Use `execution: \"internal\"`\nto forbid child processes, or `execution: \"external\"` to use only native tools.\nWebP quality control requires an external backend because Photon's WebP encoder\ndoes not accept a quality setting.\n\nRastermill refuses to decode images with unknown dimensions, images larger than the\nconfigured input pixel budget, or resize targets larger than the configured\noutput pixel budget.\n","Rastermill 是一个专为 Node.js 服务器端设计的高效图像处理库。其核心功能包括图像探查、透明度检测及编码转换，支持自动选择最合适的处理方式，如使用 Photon 进行快速内存内处理或借助 sips、ImageMagick 等外部工具处理特定格式。该库通过 TypeScript 实现，确保了跨平台的一致性和安全性，同时提供了灵活的配置选项来控制资源消耗和输出质量。适用于需要在后端进行图片预处理的应用场景，比如内容管理系统中的媒体文件优化、云存储服务中对用户上传图片的自动调整等。","2026-06-11 04:05:46","CREATED_QUERY"]