Code: Select all
gc = Magick::Draw.new
plot_count = 0
while plot_count < points.size
gc.composite(points[plot_count][0], points[plot_count][1], 0, 0, mydot, Magick::PlusCompositeOp)
plot_count += 1
end
gc.draw(base)
The canvas ("base") is "256x256 DirectClass 8-bit", and "mydot" is "4x4 4x4+0+0 DirectClass 8-bit". Both are generated by ImageMagick.
Is there anyway to capture the composite affect for a given source, so it can be repeatedly applied to different pixel locations?
Is there a way I should prep the canvas and source so there are no interstitial operations?
Now for the weird part...
Currently, for the same 25k points, on the same blank canvas, the time to render is random, from 5 to 30 seconds. My suspicion is some kind of heap operation is causing a slowdown. My other thought is this could be OSX or video card driver if imagemagick is using any OSX operations for this. My assumption is if I get things fast enough on OSX, it will be faster on a server -- but that remains to be seen -- a server won't have the GPU my desktop has.
Is there anyway to ramp up imagemagick for an operation like this?
I'm hoping someone with experience can shed some light on how to optimize any part of this operation.