
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
image-collage-maker
Advanced tools
Image-collage-maker is a Node.js package that allows you to create customizable image collages from both local and online images. The package uses `sharp` for image processing and provides various customization options, such as specifying the shape of ima
image-collage-maker is a Node.js package that allows you to create customizable image collages from both local and online images. The package uses sharp
for image processing and provides various customization options, such as specifying the shape of images, adding padding, and randomizing positions.
You can install ImageCollageMaker via npm:
npm install image-collage-maker
Here is an example of how to use ImageCollageMaker:
Place the images to be resized in the images
folder. Here is an example of how to use the image-collage-maker
package to create a collage:
const { createCollage, getImagesFromFolder } = require("image-collage-maker");
async function main() {
const folderPath = "./images";
const imagePaths = await getImagesFromFolder(folderPath);
imagePaths.push(
"https://images.unsplash.com/photo-1593642532973-d31b6557fa68"
);
const options = {
collageSize: { width: 1000, height: 1000 },
imagesPerRow: 4,
padding: 20,
margin: 20,
outputFormat: "jpeg",
outputQuality: 80,
shape: "circle", // Default shape if shapesArray is not provided
shapesArray: ["circle", "triangle", "hexagon", "rectangle"], // Optional array of shapes
userDefinedImageSize: { width: 230, height: 230 },
minImageSize: 100,
maxImageSize: 300,
outputPath: "output/collage.jpg",
backgroundColor: "#f0f0f0", // Background color in HEX format
imageMaskColors: ["#FF0000", "#00FF00"], // Example mask colors in HEX format
useMasks: false, // Set to true to apply masks
};
try {
await createCollage(imagePaths, options);
console.log("Enhanced collage created and saved.");
} catch (error) {
console.error("Error creating collage:", error);
}
}
main();
jpeg
, png
, webp
).shapesArray
is not provided.true
to apply image masks.createCollage(imagePaths: string[], options: CollageOptions): Promise<Buffer>
Creates a collage from the provided images with the specified options.
Promise
that resolves to a Buffer
containing the image data of the collage.ImageCollageMaker/
│
├── src/
│ ├── index.ts
│ ├── utils.ts
│ ├── types.ts
│ └── collage.ts
├── dist/
│ └── index.js (generated after compilation)
├── images/ (example folder for local images)
├── .gitignore
├── LICENSE
├── README.md
├── package.json
└── tsconfig.json
Contributions are welcome! Please open an issue or submit a pull request for any bugs or features.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Image-collage-maker is a Node.js package that allows you to create customizable image collages from both local and online images. The package uses `sharp` for image processing and provides various customization options, such as specifying the shape of ima
We found that image-collage-maker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.