You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to use vips_arrayjoin from sharp? #1580
...where image1 are either filenames or Buffer objects (no Streams). When animated is used, ensure array produces "toilet-roll" image and set page height etc.
Reacted by aMadReason, Clark, Moritz Klack, Miguel Laginha, John Dousaitis, Willem Mulder, Ali Ashraf, ghost, pomp (old), Meex and 6 more
for .join() would it be possible to pass a 2d array that gets split up if there’s a across parameter. I think vips_arrayjoin() already has an across parameter
@lovell Not just yet, unfortunately. I'm just getting started, and looking for a way to stitch together a bunch of smaller images. I previously implemented things in jimp but now started to look into Sharp because jimp was so memory-hungry (using >2GB for stitching 196 small images).
I tried for hours to get the best solution (combining a 4x4 grid and resizing) and anything based on composite() was very slow.
Reading all tiles into seperate raw buffers and combining them in node into a large Uint32Array and resizing and saving the result with sharp was more than twice as fast as the best composite() test i did.
I might try to fork it and hack together something that works for my usecase, but my c++ is rusty and i doubt that i can make a good contribution.
Except using this join-images module is kind of annoying so I would hope that we can just do it natively with sharp someday. In the meantime though I will continue to use join-images as a separate module 😕
But the join-images module supports only single page files/images merge (stitches the images), but If I use it for multipage tiff files merge, it didn't work. It would be great if we could get native sharp API to merge multi-page tiff files (each file can have multiple pages) into a single file.
Hi @lovell we've been struggling with @deftomat with animated images for quite some time. We've figured that we need to pass pageHeight to the raw function and then read it from baton because it is not possible to set pageHeight in gif anymore.
We were thinking where to put the setting and we wanted to create pull request but then we noticed your comment from a month ago.
This new API looks great and is possibly exactly what we need.
Can you provide any information regarding releasing v0.34.0?
Could you possibly release some alpha/beta so we can test it?
Activity
lovell commentedon Feb 17, 2019
Hello, this isn't supported at the moment, but could make a future possible enhancement.
👇 PROPOSED API, NOT YET AVAILABLE
☝️ PROPOSED API, NOT YET AVAILABLE
...where
image1are either filenames or Buffer objects (no Streams). Whenanimatedis used, ensure array produces "toilet-roll" image and set page height etc.NDevTK commentedon Feb 17, 2019
Is there a way to use the bundled libvips from the child process? #1175 (comment)
NDevTK commentedon Feb 17, 2019
for .join() would it be possible to pass a 2d array that gets split up if there’s a across parameter. I think vips_arrayjoin() already has an across parameter
lovell commentedon Feb 18, 2019
Only shared libraries are included, no executable files.
NDevTK commentedon Feb 22, 2019
How do you use a child process
images is
"img-0.jpg img-1.jpg img-2.jpg img-3.jpg img-4.jpg img-5.jpg img-6.jpg img-7.jpg img-8.jpg img-9.jpg img-10.jpg img-11.jpg img-12.jpg img-13.jpg img-14.jpg img-15.jpg img-16.jpg img-17.jpg img-18.jpg img-19.jpg img-20.jpg img-21.jpg img-22.jpg img-23.jpg img-24.jpg img-25.jpg img-26.jpg img-27.jpg img-28.jpg img-29.jpg img-30.jpg img-31.jpg img-32.jpg img-33.jpg img-34.jpg img-35.jpg img-36.jpg img-37.jpg img-38.jpg img-39.jpg img-40.jpg img-41.jpg img-42.jpg img-43.jpg img-44.jpg img-45.jpg img-46.jpg img-47.jpg"But when I run it i get
Unknown option --across 8however if I runvips arrayjoin "img-0.jpg img-1.jpg img-2.jpg img-3.jpg img-4.jpg img-5.jpg img-6.jpg img-7.jpg img-8.jpg img-9.jpg img-10.jpg img-11.jpg img-12.jpg img-13.jpg img-14.jpg img-15.jpg img-16.jpg img-17.jpg img-18.jpg img-19.jpg img-20.jpg img-21.jpg img-22.jpg img-23.jpg img-24.jpg img-25.jpg img-26.jpg img-27.jpg img-28.jpg img-29.jpg img-30.jpg img-31.jpg img-32.jpg img-33.jpg img-34.jpg img-35.jpg img-36.jpg img-37.jpg img-38.jpg img-39.jpg img-40.jpg img-41.jpg img-42.jpg img-43.jpg img-44.jpg img-45.jpg img-46.jpg img-47.jpg" --across 8 output.jpgfrom the project directory in cmd it works and creates the output.jpg filelovell commentedon Feb 22, 2019
I think you need to specify
--acrossand8as separate arguments. This is a Node thing unrelated to sharp or libvips.willemmulder commentedon Aug 27, 2020
@lovell Is this still planned? Would be very useful!
lovell commentedon Aug 28, 2020
@willemmulder PRs are always welcome, if you're able.
willemmulder commentedon Aug 28, 2020
@lovell Not just yet, unfortunately. I'm just getting started, and looking for a way to stitch together a bunch of smaller images. I previously implemented things in jimp but now started to look into Sharp because jimp was so memory-hungry (using >2GB for stitching 196 small images).
willemmulder commentedon Sep 3, 2020
@lovell Is there a way in Sharp to make raw calls to libvips? So I could call the arrayjoin function through Sharp?
ddmy commentedon Dec 2, 2021
请问一下,多张图片合成一张gif或webp动图这个功能支持的进度怎么样了? @lovell
lovell commentedon Mar 15, 2022
For those who haven't yet rolled their own
composite()based approach to this, it's been pointed out in #3137 (comment) that there's a similar solution in the form of https://github.com/ccpu/join-images that provides most of the logic for you whilst you wait for this feature.uriesk commentedon Jun 22, 2022
Maybe this
join()could instead be part of the constructor? So it could be used for further manipulation.i.e.:
I tried for hours to get the best solution (combining a 4x4 grid and resizing) and anything based on
composite()was very slow.Reading all tiles into seperate raw buffers and combining them in node into a large Uint32Array and resizing and saving the result with sharp was more than twice as fast as the best
composite()test i did.I might try to fork it and hack together something that works for my usecase, but my c++ is rusty and i doubt that i can make a good contribution.
lublak commentedon Sep 27, 2022
I don't know if it fits here but I am interested in it. Joining several frames as a gif :)
mayeaux commentedon Oct 24, 2022
I like the API offered here: https://github.com/ccpu/join-images#readme
Except using this
join-imagesmodule is kind of annoying so I would hope that we can just do it natively withsharpsomeday. In the meantime though I will continue to usejoin-imagesas a separate module 😕Sanjotarm commentedon Nov 2, 2022
But the join-images module supports only single page files/images merge (stitches the images), but If I use it for multipage tiff files merge, it didn't work. It would be great if we could get native sharp API to merge multi-page tiff files (each file can have multiple pages) into a single file.
willemmulder commentedon Mar 7, 2024
The https://github.com/ccpu/join-images repo is deprecated these days. Is there any update on this feature in sharp natively? Thanks :-)
Add support for input array to join or animate #1580
lovell commentedon Feb 7, 2025
Commit 5ab9168 adds the ability to join an array of input images to the work-in-progress
hatbranch.I've updated my original comment at #1580 (comment) to reflect the API as it has been implemented.
This will be part of the future v0.34.0 release.
Here's an example of what will be possible, in this case creating an animated GIF and PNG grid from emoji text.
Jeanno commentedon Feb 8, 2025
@lovell Love it. Until now I have been using v0.29 to create animated images from long toilet paper roll of frames. Cheers
ivanbarlog commentedon Mar 6, 2025
Hi @lovell we've been struggling with @deftomat with animated images for quite some time. We've figured that we need to pass
pageHeightto therawfunction and then read it frombatonbecause it is not possible to setpageHeightingifanymore.We were thinking where to put the setting and we wanted to create pull request but then we noticed your comment from a month ago.
This new API looks great and is possibly exactly what we need.
Can you provide any information regarding releasing
v0.34.0?Could you possibly release some alpha/beta so we can test it?
Thank you for your response in advance!
lovell commentedon Mar 7, 2025
@ivanbarlog Please subscribe to #4248 for updates about v0.34.0.
lovell commentedon Apr 4, 2025
v0.34.0 now available, thanks to those who helped test this feature.
Add support for input array to join or animate lovell#1580