I'm attempting to display images that are partially desaturated, ie they still have a little color. To do this, I first desaturate, then overlay the source to the canvas with opacity at 25% and no offset. Finally the result is scaled and cropped to 1024 x 512.
Using GD toolkit, I'm finding that derivatives of 3-5MB images are taking an age (1-2 minutes each) to generate, with a "service unavailable" (503) server error for the derivative path while they are being generated. These derivatives will get used in a homepage slideshow, so I really can't use the action as-is.
Is this sort of processing time to be expected for the "overlay source to canvas" action?
Comments
Comment #1
fietserwinGD does indeed not have such an effect so this effect is implemented as a double loop over all pixels and involves quite some computations per pixel.
What you could do:
HTH
Comment #2
dman CreditAttribution: dman commentedYeah, right from the beginning, any transparency effects were extremely expensive to produce in GD. There used to be dire warnings on the alpha-action settings form about that. There is a huge performance difference between being able to use the GD binary library effects, and running the handmade pixel processes in PHP.
fietserwins suggestions are correct - you can even do both.
Comment #3
John Pitcairn CreditAttribution: John Pitcairn commentedThanks - I like to keep the original images around, they tend to become the only copy when the client misplaces their original, so scaling on upload is not ideal. I'll look into ImageMagick first.
Comment #4
John Pitcairn CreditAttribution: John Pitcairn commentedOK, using ImageMagick, there appears to be a problem with the "overlay source to canvas" action - the convert binary isn't being given the correct path to the source. I get this log error:
If I remove the "overlay source to canvas" action and just desaturate then scale and crop, I see no errors.
Comment #5
John Pitcairn CreditAttribution: John Pitcairn commentedLooks like this is a bug in
image_imagemagick_overlay()
. If I patch that, the image generation works and is a lot faster than using GD.Filing a separate issue: #2379359: image_imagemagick_overlay() passes a stream wrapper to convert
Comment #6
fietserwinClosing this issue, assuming the OP has seen his question answered. If not, feel free to reopen, stating what your remaining questions are.