Imager-Craft icon indicating copy to clipboard operation
Imager-Craft copied to clipboard

Feature Request: Combine images

Open adrienne opened this issue 6 years ago • 2 comments

This is kind of a long shot but it seems possible; it's probably less complicated than watermarking, overall! What I'd like to be able to do is pass Imager an array (or ElementModel collection) of images, with some parameters, and have it crop them all and arrange them in a row or a grid.

My vision is that you'd have something like this:

{% set newImage = craft.imager.transformArray(imageArray, {mode: grid, grid: { gridColumnWidth: 200, gridRowHeight: 300, itemResizeMode: 'crop', gridColumns: 4, gridRows: 'auto', bgColor: '#000000' } } %}

Or something, and it would resize each image individually (to 200 x 300, in the above example) and pour them into a grid with (in the above example) 4 columns and however many rows it needs. If there was any space not filled by images, it'd fill it with a background color or leave it transparent, whatever.

adrienne avatar Oct 28 '19 00:10 adrienne

Hi,

I feel like this is a bit too far from what Imager does today, to be a natural feature to add. Also, it'd probably be easier to create a separate plugin that does just this, than trying to wrangle it into how Imager does things.

Why can't you do the grid layout in css, is it for emails or something?

I've been toying with the idea of adding functionality for merging/overlaying images, it might be that something like that could be possible to use for what you want, if abstracted enough. I'll leave this open for now so I'll remember to revisit at some point.

aelvan avatar Oct 30 '19 19:10 aelvan

@aelvan - for Facebook/Twitter card images, actually, so yeah, no CSS -- all has to be one merged image. I'm currently using the watermarking functionality to overlay one image on my background, but there's a separate usecase where i need to overlay several images at once.

adrienne avatar Nov 01 '19 02:11 adrienne