We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe. I need to create a single tiff from multiple images.(Multi pager). How can it be done.
Please share some examples. I have a directory with images and I want to generate a tiff.
The below is creating is merging the tiff file into one. but I want multi page each image with its own page.
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered const fs = require('fs'); const Jimp = require('jimp');
async function convertImagesToTiff(imagePaths, tiffOutputPath) { const images = [];
for (const imagePath of imagePaths) { const image = await Jimp.read(imagePath); images.push(image); }
// Combine images into a single TIFF image const combinedImage = await Jimp.create(images[0].bitmap.width, images[0].bitmap.height * images.length);
for (let i = 0; i < images.length; i++) { combinedImage.blit(images[i], 0, i * images[0].bitmap.height); }
// Save the combined image as a TIFF file await combinedImage.writeAsync(tiffOutputPath); console.log('TIFF file saved at:', tiffOutputPath); }
// Example usage const imagePaths = ['path/to/image1.png', 'path/to/image2.png']; const tiffOutputPath = 'output.tiff';
convertImagesToTiff(imagePaths, tiffOutputPath);
Additional context Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
I need to create a single tiff from multiple images.(Multi pager). How can it be done.
Please share some examples. I have a directory with images and I want to generate a tiff.
The below is creating is merging the tiff file into one. but I want multi page each image with its own page.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
const fs = require('fs');
const Jimp = require('jimp');
async function convertImagesToTiff(imagePaths, tiffOutputPath) {
const images = [];
for (const imagePath of imagePaths) {
const image = await Jimp.read(imagePath);
images.push(image);
}
// Combine images into a single TIFF image
const combinedImage = await Jimp.create(images[0].bitmap.width, images[0].bitmap.height * images.length);
for (let i = 0; i < images.length; i++) {
combinedImage.blit(images[i], 0, i * images[0].bitmap.height);
}
// Save the combined image as a TIFF file
await combinedImage.writeAsync(tiffOutputPath);
console.log('TIFF file saved at:', tiffOutputPath);
}
// Example usage
const imagePaths = ['path/to/image1.png', 'path/to/image2.png'];
const tiffOutputPath = 'output.tiff';
convertImagesToTiff(imagePaths, tiffOutputPath);
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: