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
Join two images #376
Comments
Not out of the box and automatically. But I think it would be easy to achieve this with canvas(), insert(), width() and height(). Ideally you wrap it in a custom filter at the end. |
hello @olivervogel Thanks for the idea. Did not think about this. Firstly I tried: $img_canvas = Image::canvas(200, 100);
$img_canvas->fill(Image::make('img/color.jpg'), 0, 0);
$img_canvas->fill(Image::make('img/grey.jpg'), 100, 0); // add offset
$img_canvas->save('img/canvas.png', 100); But it was adding same (color) picture over and over. Using insert: $img_canvas = Image::canvas(200, 100);
$img_canvas->insert(Image::make('img/color.jpg'));
$img_canvas->insert(Image::make('img/grey.jpg'), 'top-right'); // add offset
$img_canvas->save('img/canvas_horizontal.png', 100);
$img_canvas = Image::canvas(100, 200);
$img_canvas->insert(Image::make('img/color.jpg'));
$img_canvas->insert(Image::make('img/grey.jpg'), 'bottom-left'); // add offset
$img_canvas->save('img/canvas_vertical.png', 100); I basicly can achieve what I wanted :) We will see If I will manage it. So far very 'eloquent-like' lib :) Thanks! |
It's also possible to insert directly, without creating a new image instance. $img_canvas = Image::canvas(200, 100);
$img_canvas->insert('img/color.jpg');
$img_canvas->insert('img/grey.jpg', 'top-right'); // add offset
$img_canvas->save('img/canvas_horizontal.png', 100); |
Hello,
is there a way to join two images? i.e. horizontally or vertically?
say I have two images 50x100.
If I join them horizontaly, I get 50x200 size
if I join them vertically - I would get: 100x100 size
Thanks!
The text was updated successfully, but these errors were encountered: