{"id":18484203,"url":"https://github.com/jdf2e/jdf-images","last_synced_at":"2025-10-11T20:32:30.844Z","repository":{"id":96112375,"uuid":"74090861","full_name":"jdf2e/jdf-images","owner":"jdf2e","description":"jdf-images","archived":false,"fork":false,"pushed_at":"2017-01-13T08:03:50.000Z","size":9107,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T00:53:09.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdf2e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-18T03:14:14.000Z","updated_at":"2024-04-04T01:18:48.000Z","dependencies_parsed_at":"2023-04-30T19:16:23.640Z","dependency_job_id":null,"html_url":"https://github.com/jdf2e/jdf-images","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jdf2e/jdf-images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdf2e","download_url":"https://codeload.github.com/jdf2e/jdf-images/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdf2e%2Fjdf-images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008618,"owners_count":26084480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:38:52.746Z","updated_at":"2025-10-11T20:32:30.828Z","avatar_url":"https://github.com/jdf2e.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### wrapper for images\n\n\n![images logo](https://raw.github.com/zhangyuanwei/node-images/master/demo/logo.png)\n===========\n\nCross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Node.js  \nNode.js轻量级跨平台图像编解码库\n\n``` javascript\nvar images = require(\"images\");\n\nimages(\"input.jpg\")                     //Load image from file \n                                        //加载图像文件\n    .size(400)                          //Geometric scaling the image to 400 pixels width\n                                        //等比缩放图像到400像素宽\n    .draw(images(\"logo.png\"), 10, 10)   //Drawn logo at coordinates (10,10)\n                                        //在(10,10)处绘制Logo\n    .save(\"output.jpg\", {               //Save the image to a file,whih quality 50\n        quality : 50                    //保存图片到文件,图片质量为50\n\t});\n```\n## Features 功能特性\n\n* Lightweight:no need to install any image processing library.\n* 轻量级：无需安装任何图像处理库。\n* Cross-platform: Released a compiled .node file on windows, just download and start.\n* 跨平台：Windows下发布了编译好的.node文件,下载就能用。\n* Easy-to-use: Provide jQuery-like chaining API.Simple and reliable!\n* 方便用：jQuery风格的API，简单可依赖。\n\n## Installation 安装\n\t$ npm install images\n\n## API 接口\n\nnode-images provide jQuery-like Chaining API,You can start the chain like this:  \nnode-images 提供了类似jQuery的链式调用API,您可以这样开始:\n\n```javascript\n/* Load and decode image from file */\n/* 从指定文件加载并解码图像 */\nimages(file)\n\n/* Create a new transparent image */\n/* 创建一个指定宽高的透明图像 */\nimages(width, height)\n\n/* Load and decode image from a buffer */\n/* 从Buffer数据中解码图像 */\nimages(buffer[, start[, end]])\n\n/* Copy from another image */\n/* 从另一个图像中复制区域来创建图像 */\nimages(image[, x, y, width, height])\n```\n\n### images(file)\nLoad and decode image from file  \n从指定文件加载并解码图像\n\n### images(width, height)\nCreate a new transparent image  \n创建一个指定宽高的透明图像\n\n### images(buffer[, start[, end]])\nLoad and decode image from a buffer  \n从Buffer数据中解码图像\n\n### images(image[, x, y, width, height])\nCopy from another image  \n从另一个图像中复制区域来创建图像\n\n### .fill(red, green, blue[, alpha])\neg:`images(200, 100).fill(0xff, 0x00, 0x00, 0.5)`\nFill image with color  \n以指定颜色填充图像\n\n### .draw(image, x, y)\nDraw *image* on the current image position( *x* , *y* )  \n在当前图像( *x* , *y* )上绘制 *image* 图像\n\n### .encode(type[, config])\neg:`images(\"input.png\").encode(\"jpg\", {operation:50})`\nEncode image to buffer, *config* is image setting.  \n以指定格式编码当前图像到Buffer，config为图片设置，目前支持设置JPG图像质量  \nReturn buffer  \n返回填充好的Buffer  \n**Note:The operation will cut off the chain**  \n**注意:该操作将会切断调用链**  \nSee:.save(file[, type[, config]])\n参考:.save(file[, type[, config]])\n\n### .save(file[, type[, config]])\neg:`images(\"input.png\").encode(\"output.jpg\", {operation:50})`\nEncoding and save the current image to a *file*, if the *type* is not specified, *type* well be automatically determined according to the *file*, *config* is image setting. eg: `{ operation:50 }`  \n编码并保存当前图像到 *file* ,如果type未指定,则根据 *file* 自动判断文件类型，config为图片设置，目前支持设置JPG图像质量\n\n### .size([width[, height]])\nGet size of the image or set the size of the image,if the height is not specified, then scaling based on the current width and height  \n获取或者设置图像宽高，如果height未指定，则根据当前宽高等比缩放\n\n### .resize(width[, height])\nSet the size of the image,if the height is not specified, then scaling based on the current width and height  \n设置图像宽高，如果height未指定，则根据当前宽高等比缩放, 默认采用 bicubic 算法。\n\n### .width([width])\nGet width for the image or set width of the image  \n获取或设置图像宽度\n\n### .height([height])\nGet height for the image or set height of the image  \n获取或设置图像高度\n\n### images.setLimit(width, height)\nSet the limit size of each image  \n设置库处理图片的大小限制,设置后对所有新的操作生效(如果超限则抛出异常)\n\n### images.setGCThreshold(value)\nSet the garbage collection threshold  \n设置图像处理库自动gc的阈值(当*新增*内存使用超过该阈值时，执行垃圾回收)\n\n### images.getUsedMemory()\nGet used memory (in bytes)  \n得到图像处理库占用的内存大小(单位为字节)\n\n### images.gc()\nForced call garbage collection  \n强制调用V8的垃圾回收机制\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fjdf-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdf2e%2Fjdf-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdf2e%2Fjdf-images/lists"}