The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
I have this command, it takes 8x8 source image and generate a tile image.
For that I wrote below code. But it takes too much time. I get the expected image but code is not well written. Could you please give me suggestion in it?
As this is a new question, I have started a new thread for it.
You are reading the same file 20,000 times. If you really want 20,000 images, cloning will be faster than reading files. (I don't use Wand, but MagickAddImage() seems useful.)
I assume tileC.jpg is 8x8 pixels. So perhaps using NULL for thumbnail_geometry will be faster.
Also, perhaps using NULL for frame will be faster.
But I don't understand why you want 20,000 images, montaged together. Can't you simply read "tile:tileC.jpg"?
Check above two links, I have provided the images. I have a source image of 8x8 and I want the final result like second image. So I read source image multiple time and create a tile image. And as you have mentioned that simply create a tile image using "tile:tileC.jpg", you means MagickReadImage(wand, "tile:tileC.jpg"); this way?
% MagickTextureImage() repeatedly tiles the texture image across and down the
% image canvas.
%
% The format of the MagickTextureImage method is:
%
% MagickWand *MagickTextureImage(MagickWand *wand,
% const MagickWand *texture_wand)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
% o texture_wand: the texture wand
I haven't tried it but it seems to do what you want. texture_wand will be tileC.jpg and wand will be a blank canvas of the required size.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
A couple of notes:
- the tile doesn't fit exactly in 1200x874.
- I specifically test that MagickTextureImage returns a valid pointer. I first tried this without "MagickReadImage(wand,"xc:white");" and it returned NULL. Don't know why that makes a difference.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
P.S. I compiled the example with ImageMagick 6.9.7-10 Q16 x64.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
A couple of notes:
- the tile doesn't fit exactly in 1200x874.
- I specifically test that MagickTextureImage returns a valid pointer. I first tried this without "MagickReadImage(wand,"xc:white");" and it returned NULL. Don't know why that makes a difference.
Pete
This is working for me. Thank you el_supremo.
Version: ImageMagick 7.0.5-4 Q16 x86_64 2017-03-28 http://www.imagemagick.org