What's the fastest method for drawing one image over another?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

What's the fastest method for drawing one image over another?

Post by Airon65 » 2017-04-16T02:29:34-07:00

Now I use:

Code: Select all

image2.compose( image1, x, y, Magick::OverCompositeOp );
Is there a faster way for drawing one image over another than the compose? I really need it :)
Image2 is always bigger than image1. Image1 places at the center of the image2.

ImageMagick 7.0.5-2 Q16 x86_64 2017-03-11

snibgo
Posts: 9399
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: What's the fastest method for drawing one image over another?

Post by snibgo » 2017-04-16T06:04:16-07:00

If the two images are close to the same size, I doubt if any other technique is much faster. If the images are very different sizes, perhaps another method such as DrawableCompositeImage is faster.
snibgo's IM pages: im.snibgo.com

Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Re: What's the fastest method for drawing one image over another?

Post by Airon65 » 2017-04-16T08:30:10-07:00

I've checked out these methods and they are give me following results on the same image:

Code: Select all

>>>>>> composite: 0.096247 sec.
>>>>>> DrawableCompositeImage: 0.758551 sec.
Seems that DrawableCompositeImage more than 7 times slower than composite one :) I've checked it using 100 attempts for composite and DrawableCompositeImage.

My ENV is: macOS 10.12.3, poor Core2duo CPU (without CUDA enabled because I have integrated GPU :) ).

Post Reply