-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
Enhancement: support multiple overlayWith in single pipeline (including blend modes) via vips_composite #728
Comments
Hello, if you've not already seen them, a few similar questions are #405 #597 and #699 Using the current API, I'd probably suggest looking at #470 (comment) for how to start with a blank canvas. This can then be processed multiple times, each using |
I'm trying to do the same thing. So far the example code on #405 looks the cleanest to me. However, it creates a new sharp object of the whole thing on each small image that is overlaid over a bigger one. In terms of performance this is impractical for me. Are there any other solutions? Thanks |
Hello @lovell, I installed the branch version, performance is still undoable. Are there any modifications to the code example I need to make? Is there no way to do something like
? |
How about, in the meantime, printing a warning when using a second overlayWith in the same pipeline? I was pretty confused when it wasn't working… |
This would be great |
There's a discussion about adding an image composition operation to the underlying libvips library that will help with this feature request - see https://github.com/jcupitt/libvips/issues/657 |
The upstream issue was closed a few weeks ago. Is this unblocked now? |
@CWSpear This will require libvips v8.6.0 (sharp v0.19.x). If you're interested in submitting a PR then sharp has a work-in-progress |
Hi @lovell / @CWSpear any news on adopting this great feature? I would really appreciate having this feature. I can help on https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sharp. |
Hi @lovell, thank you for working on this. Did you made any progress? Kind regards |
@rui-cruz This task is now unblocked, thanks for the nudge. PRs welcome as always. |
I wish I could help, but I have no knowledge for such thing :( I can help with the types for typescript though.. |
+1 |
+1 |
Commit 7cafd43 on the The proposed API is documented at https://github.com/lovell/sharp/blob/uptake/docs/api-composite.md It can be tested now by using This will be in sharp v0.22.0. |
Hi @lovell This library is great! I've got 0.21.3 running and was looking to fiddle with the composite api. I've set up a light weight node script with a duplicate of the red/blue/green boxes that you use in the unit tests as well as the sample code, but toBuffer seems to return only the buffer for the first image in the sharp constructor. The composite images never seem to be added, though the code is run (and I've stepped through it). Is there a final pipeline trigger required to get the composites to combine? |
@jamesvillarrubia This feature is not in v0.21.3 - it is only available in the |
Sorry, I was unclear. I’m on the uptake branch and I’m trying to help test it, but I can’t get the composite function to trigger. |
@jamesvillarrubia Please can you provide a code sample, perhaps as a separate repo/gist, that exhibits this behaviour. |
I'm seeing a similar thing. If i pull down the source of this repo, it seems to work, but when using it as a dependency it doesn't seem to work. Check this out: https://github.com/mtbottens/sharp-composite-example/blob/master/index.js If you clone down that repo and run |
Of course! Should have done that to begin with: When I hit
|
Ah, sorry, you'll need to pass the |
Perfect! Figured it was something simple. For those that read this later, I also had to point pyenv python2 to any appropriate version for the node-gyp to work. In the repo, I ran:
and that solved it! |
Hi, testing out the new composite function but for some reason the end result contains only the first image from inputsteam array, here's my code:
So for some reason output image only contains only first image (background). Any Ideas? |
You might check out the comment above. I had the same issue - I wasn't using |
v0.22.0 now available with this feature, thanks all for the testing and feedback. |
This is awesome! Thank you so much for this! |
i replaced overlayWith with composite but |
@Dramex Use |
I'm looking for option to combine multiple images, side by side or one under another.
I looked the
overlayWith
function but seems it can't do what is required. I also looked inlibvips options and maybe
.reduce
is what we need. Please share with me any idea of realization if there is nothing implemented yet.The text was updated successfully, but these errors were encountered: