I've pretty much learned how to adjust the individual images/layers to correct color or remove backgrounds, etc., but I'm failing to understand how to output the adjusted images together in one, layered image.
Here's what I'm doing so far. I'd post code, but I've mangled it a little and it's not currently producing anything, although this process is the general process I see in my mind.
I create a blank 750x750 Imagick image and set its background to white. This is essentially the container image.
I create an instance of Imagick for each component image, and do whatever I need to do to prepare that image/layer. There could be any number of these, but probably not more than two or three. That doesn't really matter, though, as each should be on a separate layer and still be vector if the source image was vector, embedded/raster if the source was raster.
For any text layers, I create essentially a duplicate of the container layer and set its background to transparent (create it with a green background, then use
Code: Select all
$im->paintTransparentImage(new ImagickPixel("green"), 0.0, 0);
I then create a new, final Imagick instance, then ::addImage() each image/layer.
I tried simply outputting this, and it simply outputs the last image added as an EPS.
I also tried methods such as ::coalesceImage() and ::combineImage(), to no avail. I also tried ::getImagesBlob(), but it failed to produce any output at all.
I also tried compositing each image onto the container, but the output of that was an EPS with an embedded, rasterized version of the image, which is useless.
So, I guess my question is this: How can I produce layered, vector output?
I'll continue banging away at this tomorrow when I return to work, but hopefully one of y'all can point me in the correct direction, or tell me that my goal is unattainable with Imagick.