Mike Schroder said:
“WP_Image_Editor is built to handle one file at a time, and there isn’t anything built in to combine two images by default.
The main reason here is that the files in-memory aren’t compatible with one-another if different editors (say, GD and Imagick) are used for each.
There are a few different ways to handle it, of course, but one way to solve the problem here would be to load one of the two images, then extend the Imagick editor (or both editors, if you prefer more compatibilty) to support combining images. Say, with a $image->combine( ‘filename’ ) method.
First, you’d load one of the images with wp_get_image_editor() (and specify that ‘combine’ is a required method), then call your combine method while specifying the second image.”
Related Posts:
- remove or update add_image_size
- get the attachement url for the medium sized image
- Each custom image size in custom upload directory?
- Is there a simple way to just insert a link to an image (without inserting an image)?
- Watermarking Images with WordPress with WP_Image_Editor
- Get attachment/image info in JS
- Auto-modifying original [full size] images
- Get attachment ID of author_meta image – Attachment Metadata
- Black and White thumbnails
- Crop image to horizontal or vertical by code based on image size
- Pasting images removes class attribute
- Alter image output in content
- How can I remove the image attachment ALT field?
- Open the attachment details modal
- Download button for Featured Image in every post – automatically
- Change html structure of all img tags in WordPress
- Get a list of all image sizes that match aspect ratio of original one
- Randomly add a ‘ul’ list of images
- Can’t access ‘Store uploads in this folder’
- How to Display Featured Image Title and ALT Attribute
- Is it possible to recover featured images after WordPress export/import
- Thumbnails are bigger in size than the original image
- The the post id from image id
- Add attribute to caption shortcode from custom attachment field
- Get an image’s alt text in a shortcode using the image URL
- Add Small Image Size to Media Settings
- function to show only featured image of the posts
- Image resize depending on orientation?
- Character Limit w/ Excerpt removes Images Why?
- Featured images not displaying at full resolution
- Check if the image exists in WordPress media library
- Adding new size for Media screen in functions.php not working
- After installing ssl certificate images won’t show
- Faster way to put images into a blog post by using Add Media dialog
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox
- Retrieve an array of image URLs that belong to a gallery
- Help With Custom Image and Text Widget
- Using SRCSET with Images and Featured Images
- How to make a gallery with dynamic images from URLs?
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- add_image_size wont work after get_intermediate_image_sizes
- Ways to show multiple, separate galleries per post?
- How to get the image-URL from Media-Upload in a post?
- How to get the Gallery form/section just like in Gutenberg block?
- One of my image sizes isn’t showing up in srcset
- Conflict with single and double quotes
- Featured Image Cetegory Not Shown In WordPress
- Force default OG:Image – Yoast SEO [closed]
- after migration, newly uploaded images won’t show up
- Why do I have blury images in WordPress
- Disable save as image on smartphones using all browsers ( chrome, firefox, ie, cm, opera )
- How to get the title of the random images from media library?
- How To Display Author Photo In WordPress without any plugin?
- limit number of images shown from gallery
- Alter the image used for a user who has not uploaded a custom image yet
- Allow users to upload multiple images to their profile
- how to change format jpg to webp?
- User uploads image as “Featured Image” but WordPress resizes it?
- Allow a specific user role I have created to only upload one image to his media library
- Implementing a modal(lightbox) for all images in all post-gallery posts
- how to regenerate webp et-pb-portfolio-image
- How to increase media image scale limit?
- How do I avoid color distortion of uploaded images?
- Where to put code that customizes API
- Force WordPress to always generate a thumbnail for original image
- When upload a PNG a noise appears in the thumbnails
- How to auto add image caption from image alt?
- File upload size limit in wordpress and php.ini limit
- How to add php to theme to show alt attributes
- Display Title/Description/Caption of custom images on homepage
- Blank image thumbnails in media library
- Getting extra image links in code with wp_get_attachment_image
- featured image in custom poste type (backend)
- Get “Image CSS Class” value from the Advanced Options section
- After reinstalling wordpress images do not appear in posts?
- Dinamically modifying attributes of images on posts
- Run command to optimize images after they get uploaded to WordPress
- How decrease the size of images which are present in uploads folder?
- Show images from TEXT section on PAGE wordpress
- Where to add my code to auto attach images to existing products
- Large size is not honoured when inserting image
- If file exists with page slug name show image else nothing
- Issue uploading images
- How can I use images that are on the server locally?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- The most of the images don’t appear, although URLs are correct
- Get images uploaded to this post in popup on editor screen
- Remove “align” attribute on images
- Paginate Gallery [closed]
- How do I add a nested conditional within an echo – to use a default image if there isn’t one in the post?
- WordPress: Preload next post images
- How do I change a Themes Header Image?
- Some images 404
- Blurry Images WordPress 5.8.1
- Why is inline CSS added to images automatically? [closed]
- How to show file size of featured image? [duplicate]
- I am having trouble displaying an image at the top of a widget area [closed]
- Can’t upload svg files in WordPress
- Images uploaded in customized gallery do not link to media