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
I'd like to be able to join a collection of images into a single RGB image with sharp, as in vips bandjoin. I can think of two ways to go about this, but I think both of them are a little ugly.
Overload the sharp constructor to accept an object or array containing image filenames or buffers to be joined before being processed:
The downside to method 1 is that it is not semantically clear what will happen with the array of images. This could be mitigated by putting them in an object with some descriptive key, such as {0:image1, 1:image2, 2:image3}. The downside to method 2 is that it spreads out the image bands where they should be logically grouped together. There's nothing special about image1 vs image2 and image3, except that it's supposed to end up in band 0.
Thoughts and suggestions? I plan to submit a pr for something like this, and I'm leaning towards method 1.
The text was updated successfully, but these errors were encountered:
Hi Matt, method 2 is much closer to the underlying libvips operations required to achieve a "bandjoin" and, as you suggest, the method 1 approach to listing multiple input files could lead to ambiguity, so my vote is with the second approach.
joinChannel seems like a good (consistent, clear) name for this operation.
Thanks again for all your recent work to expose more libvips operations. These are much appreciated and have the potential to draw in a whole new community of people more deeply involved with image processing!
Thanks a bunch for your comments. I'll work on something that looks like joinChannel above.
And thanks also for considering my patches. I would love to see something (perhaps a different project) down the road that's closer to a more general node-vips interface but for now, with what I've added, sharp is working really well for me. This is a very high quality project! I really appreciate what you've done with it.
I'd like to be able to join a collection of images into a single RGB image with sharp, as in vips
bandjoin
. I can think of two ways to go about this, but I think both of them are a little ugly.The downside to method 1 is that it is not semantically clear what will happen with the array of images. This could be mitigated by putting them in an object with some descriptive key, such as
{0:image1, 1:image2, 2:image3}
. The downside to method 2 is that it spreads out the image bands where they should be logically grouped together. There's nothing special about image1 vs image2 and image3, except that it's supposed to end up in band 0.Thoughts and suggestions? I plan to submit a pr for something like this, and I'm leaning towards method 1.
The text was updated successfully, but these errors were encountered: