简体   繁体   中英

PHP: two images (after resize with ratio) into shape as one image

I want to resize my two images to fit best and keep ratio and put them into shape (two circles). I am wondering about easier method to resolve my problem. I want to get this result shown on image below:

在此处输入图片说明

  1. Load src image 1 and src image 2: I got this
  2. to square with aspect ratio: I use Eventviva/Php-image-resize
  3. to circle: I found some code for this on stackoverflow, but still finding and trying to get the best
  4. to shape: I don't know how to do it (my idea written below)

My idea: I was thinking about use imagecopymerge in this way: open imagecircle1, then add white outline border on imagecircle2, then set imagecircle2 with border to right bottom corner and save but first of all - it wont be transpared because of white border, moreover I am sure that easier way exists but I cant find it.

Any ideas how to get result shown on image with easier way? Or if my idea is correct, can you help me a bit with shape?

Lukasz, a good place to start is to use image transformations service via URL where you can mesh your images together in various ways, applying filters, backgrounds, reshape, etc.

HTH.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM