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

Open
ghost opened this Issue Mar 3, 2017 · 18 comments

Comments

10 participants
@ghost

ghost commented Mar 3, 2017

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 in
libvips options and maybe .reduce is what we need. Please share with me any idea of realization if there is nothing implemented yet.

@lovell

This comment has been minimized.

Owner

lovell commented Mar 4, 2017

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 overlayWith with the relevant values for top and left.

@lovell lovell added the question label Mar 4, 2017

@Etiene

This comment has been minimized.

Etiene commented Mar 7, 2017

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

@lovell

This comment has been minimized.

Owner

lovell commented Mar 7, 2017

Hi @Etiene, your performance concerns may be covered by #573.

@Etiene

This comment has been minimized.

Etiene commented Mar 7, 2017

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

sharp('base.jpg')
  .overlayWith('mask1.png',{top:10, left:10})
  .overlayWith('mask2.png',{top:80, left:100})
  .overlayWith(.....)
  .....
  .toBuffer(....)

?

@lovell

This comment has been minimized.

Owner

lovell commented Mar 7, 2017

@Etiene The branch referred to in #573 is a WIP and does not yet improve things. The API you propose, although unsupported at present, would make a great future possible enhancement, thank you.

@lovell lovell changed the title from combine multiple images into one to Enhancement: support multiple overlayWith in single pipeline Mar 27, 2017

@lovell lovell added enhancement and removed question labels Mar 27, 2017

@wmertens

This comment has been minimized.

wmertens commented Apr 23, 2017

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…

@Lasto13

This comment has been minimized.

Lasto13 commented May 8, 2017

This would be great

@lovell

This comment has been minimized.

Owner

lovell commented May 18, 2017

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

@CWSpear

This comment has been minimized.

CWSpear commented Oct 27, 2017

The upstream issue was closed a few weeks ago. Is this unblocked now?

@lovell

This comment has been minimized.

Owner

lovell commented Oct 28, 2017

@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 suit branch you can experiment with now.

@rui-cruz

This comment has been minimized.

rui-cruz commented Nov 21, 2017

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.

@lovell lovell changed the title from Enhancement: support multiple overlayWith in single pipeline to Enhancement: support multiple overlayWith in single pipeline (including blend modes) via vips_composite Jan 6, 2018

@rui-cruz

This comment has been minimized.

rui-cruz commented Jan 22, 2018

Hi @lovell, thank you for working on this. Did you made any progress?

Kind regards

@lovell

This comment has been minimized.

Owner

lovell commented Jan 23, 2018

@rui-cruz This task is now unblocked, thanks for the nudge. PRs welcome as always.

@rui-cruz

This comment has been minimized.

rui-cruz commented Jan 23, 2018

I wish I could help, but I have no knowledge for such thing :( I can help with the types for typescript though..

@AssaultKoder95

This comment has been minimized.

AssaultKoder95 commented Jul 20, 2018

Hi @lovell
do we now support multiple overlayWith in single pipleline?
& do we have support for overlayWith & negative values?

@z3niths

This comment has been minimized.

z3niths commented Jul 26, 2018

Any progress of this feature ?

@delijah

This comment has been minimized.

delijah commented Aug 7, 2018

+1

@adityapatadia

This comment has been minimized.

adityapatadia commented Dec 4, 2018

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment