{"id":19228029,"url":"https://github.com/ecomgraduates/ez-image-gen","last_synced_at":"2025-07-26T23:34:09.803Z","repository":{"id":205656195,"uuid":"714758224","full_name":"EcomGraduates/ez-image-gen","owner":"EcomGraduates","description":"Easily generate images from a list or from cli","archived":false,"fork":false,"pushed_at":"2023-12-28T23:47:44.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T02:06:47.517Z","etag":null,"topics":["bulk","bulk-image-generator","generator","image","image-generator","images"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EcomGraduates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-11-05T19:18:02.000Z","updated_at":"2023-12-28T19:43:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"26c842d7-cdfc-495d-a256-f99134937431","html_url":"https://github.com/EcomGraduates/ez-image-gen","commit_stats":null,"previous_names":["ecomgraduates/ez-image-gen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EcomGraduates/ez-image-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EcomGraduates%2Fez-image-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EcomGraduates%2Fez-image-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EcomGraduates%2Fez-image-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EcomGraduates%2Fez-image-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EcomGraduates","download_url":"https://codeload.github.com/EcomGraduates/ez-image-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EcomGraduates%2Fez-image-gen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267265325,"owners_count":24061541,"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-07-26T02:00:08.937Z","response_time":62,"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":["bulk","bulk-image-generator","generator","image","image-generator","images"],"created_at":"2024-11-09T15:26:30.508Z","updated_at":"2025-07-26T23:34:09.751Z","avatar_url":"https://github.com/EcomGraduates.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n# Image Generator CLI \n\nImage Generator CLI is a Node.js command-line utility for creating images with customizable text overlays and watermarks. It allows users to quickly generate images with specific dimensions, background colors, text properties, and watermarking, useful for batch processing image creation for various needs such as placeholders, test data, or social media.\n\n## Getting Started\n\nEnsure you have Node.js installed on your machine to use this tool.\n\n### Installation\n\n1. Clone the repository: `git clone https://github.com/EcomGraduates/ez-image-gen.git`\n2. Navigate to the directory: `cd ez-image-gen`\n3. Install the required NPM packages: `npm install`\n\n### Dependencies\n\nThis tool requires the following npm packages:\n\n- `sharp` - A high-performance Node.js image processing library used to generate images.\n- `yargs` \u0026 `@yargs/helpers` - Libraries to help build interactive command-line tools by parsing arguments and generating an elegant user interface.\n- `fs` \u0026 `path` - Core Node.js modules to handle the file system and file paths.\n- `canvas` - A Node.js module that provides a Canvas API for Node.js, used for image manipulation such as applying opacity to watermarks.\n\n## Usage\n\n### Generate a Single Image or Multiple Images\n\nYou can generate a single image or specify the number of images to generate with the `--amount` option:\n\n```\nnode ez-image-gen.js --amount 5\n```\n\nThis command generates 5 images with default settings.\n\n### Customize Image Properties\n\nYou can customize the width, height, background color, text color, font size, and watermarks of the images:\n\n```\nnode ez-image-gen.js --amount 1 --width 300 --height 300 --bg \"#FFFFFF\" --tc \"#000000\" --fontSize 24 --watermarks \"[{\\\"path\\\":\\\"path/to/watermark1.png\\\",\\\"position\\\":\\\"southeast\\\",\\\"opacity\\\":0.6,\\\"width\\\":100,\\\"height\\\":100, \\\"rotation\\\":45}, {\\\"path\\\":\\\"path/to/watermark2.png\\\",\\\"position\\\":\\\"center\\\",\\\"opacity\\\":0.4,\\\"width\\\":80,\\\"height\\\":80, \\\"rotation\\\":-30}]\"\n```\n\nThis will generate a 300x300 image with a white background, black text, font size 24, and  watermarks at the southeast position with 60% opacity 45 degree rotation and center position with 40% opacity and -30 degree rotation.\n\n### Watermark Options\n\nYou can add a watermark to your images by specifying the watermark option in the JSON configuration. The watermark option should include:\n\n- `path`: URL or local path to the watermark image.\n- `position`: Position of the watermark on the image (e.g., `center`, `southeast`, `northwest`).\n- `opacity`: Opacity level of the watermark, ranging from 0 (fully transparent) to 1 (fully opaque).\n- `width`: Width of the watermark in pixels.\n- `height`: Height of the watermark in pixels.\n\n### Use a Text or JSON List for Bulk Generation\n\nTo generate images using a list of text overlays and watermarks, use the `--list` option with a `.json` file:\n\n```\nnode ez-image-gen.js --list path/to/configList.json\n```\n\n### Specify Output Filename and Format\n\nBy default, images are saved using a prefix and an auto-incrementing number. You can specify a different prefix and choose the format of the images (`jpg`, `png`, `webp`):\n\n```\nnode ez-image-gen.js --amount 10 --prefix \"custom-\" --format png --output \"./output\"\n```\n\n### Auto Font Size Adjustment\n\nThe `--autoFontSize` option allows the font size to be automatically adjusted based on the image dimensions:\n\n```\nnode ez-image-gen.js --amount 1 --auto-fs\n```\n\n### Output Path\n\nUse the `--output` option to specify the directory where the generated images will be saved:\n\n```\nnode ez-image-gen.js --amount 1 --output path/to/outputDirectory\n```\n\n## Installing via NPM\n\n```\nnpm i ez-image-gen\n```\n\n### Use Command `ez-image-gen`\n\nAfter installation, you can run the tool directly:\n\n```\nez-image-gen --amount 10 --prefix \"custom-\" --format png --output \"./output\"\n```\n\n---\n\n## Using as a Node.js Module\n\nIn addition to being a command-line utility, Image Generator CLI can also be used as a module in your Node.js projects. This feature allows you to integrate image generation capabilities directly into your applications.\n\n### Module Installation\n\nIf you have not already cloned the repository and installed dependencies:\n\n```\nnpm install ez-image-gen\n```\n\n### Usage as a Module\n\nTo use Image Generator in your Node.js application, import the `generateImage` function from the `ez-image-gen` package:\n\n```javascript\nimport { generateImage } from 'ez-image-gen';\n\nconst options = {\n      width: 1000,\n      height: 1000,\n      backgroundColor: \"#0000ff\",\n      textColor: \"#FFFFFF\",\n      fontSize: 24,\n      autoFontSize: true,\n      textOverlay: 'Your text here',\n      outputPath: `./your_path_here`,\n      filename: 'filename',\n      format: 'png',\n      verbose: true,\n      watermarks: [\n        {\n            path: \"https://ecomgraduates.com/cdn/shop/files/big_social_32x32.png?v=1626614407\",\n            position: \"southeast\",\n            opacity: 0.6,\n            width: 100,\n            height: 100,\n            rotation: 45\n        },\n        {\n            path: \"https://ecomgraduates.com/cdn/shop/files/big_social_32x32.png?v=1626614407\",\n            position: \"center\",\n            opacity: 0.4,\n            width: 80,\n            height: 80,\n            rotation: -30\n        }\n      ],\n    }\n\ngenerateImage(options)\n  .then(() =\u003e console.log('Image generated successfully'))\n  .catch(err =\u003e console.error(err));\n```\n\nThis will generate an image based on the specified options and save it to the output path.\n\n## Contributing\n\nContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomgraduates%2Fez-image-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomgraduates%2Fez-image-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomgraduates%2Fez-image-gen/lists"}