Fast Image Overlay (constant overlay image)
Posted: 2018-05-16T12:23:59-07:00
I want to overlay an image over a background image.
In my case the overlay image is constant (for example a logo or signature) but background image is variable.
Is there any way to leverage the fact that overlay image is constant?
I tried using .mpc file but gains are negligible.
My primary concern in performance as i have to do this in runtime/online .
There is other option where i can use draw command in place of overlay. But i have not found a consistent way to figure out font dimensions when rendered wrt to pointsize. I tried the methods described in imagemagick doc for font metric calculation. But those are 2-3 pixels inconsistent when rendered.
If anybody has better font metrics calculation method, please share.
Also Does draw method first creates image and overlay on background, or does it change the background pixels in place without creating any temporary image?
In my case the overlay image is constant (for example a logo or signature) but background image is variable.
Is there any way to leverage the fact that overlay image is constant?
I tried using .mpc file but gains are negligible.
My primary concern in performance as i have to do this in runtime/online .
There is other option where i can use draw command in place of overlay. But i have not found a consistent way to figure out font dimensions when rendered wrt to pointsize. I tried the methods described in imagemagick doc for font metric calculation. But those are 2-3 pixels inconsistent when rendered.
If anybody has better font metrics calculation method, please share.
Also Does draw method first creates image and overlay on background, or does it change the background pixels in place without creating any temporary image?