SOS!
When I Use The Plugin of MagickWand, can not find the realization of three-dimensional image perspective and distortion of the call-related function, please help me to solve this problem,Thanks
I need a picture of the effect like this :
i am from china,my english is so poor,sorry
here is some effect in cmd mode,but with MagickWand ,how to achieve
convert building.jpg -matte -virtual-pixel transparent \
-distort Perspective \
'7,40 4,30 4,124 4,123 85,122 100,123 85,2 100,30' \
building_pers.png
Some problem in useing,please help me
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Some problem in useing,please help me
I've been trying to get your perspective distort to work with a MagickWand program but without success.
I applied your perspective transformation to the built-in logo: image using the command line:
which produces this image:
My program (below) produces this image:
@magick: I've tried all sorts of combinations of setting the options and imageproperties before and after the read, setting the background colour etc. and I can't get it to produce the transparent part that the command line produces. What am I missing here? (the program and command line are both using IM 6.4.4)
Pete
I applied your perspective transformation to the built-in logo: image using the command line:
Code: Select all
convert logo: -matte -virtual-pixel transparent -distort Perspective \
'7,40 4,30 4,124 4,123 85,122 100,123 85,2 100,30' \
logo_d_p.png
My program (below) produces this image:
@magick: I've tried all sorts of combinations of setting the options and imageproperties before and after the read, setting the background colour etc. and I can't get it to produce the transparent part that the command line produces. What am I missing here? (the program and command line are both using IM 6.4.4)
Pete
Code: Select all
#include <windows.h>
#include <wand/magick_wand.h>
void test_wand(void)
{
MagickWand *mw = NULL;
double cpoints[16] = {
7,40, 4,30, 4,124, 4,123, 85,122, 100,123, 85,2, 100,30
};
MagickWandGenesis();
mw = NewMagickWand();
MagickReadImage(mw,"logo:");
// -matte is the same as -alpha on
MagickSetImageAlphaChannel(mw,SetAlphaChannel);
MagickSetImageProperty(mw,"virtual-pixel","transparent");
// and then apply the result to the image
MagickDistortImage(mw,PerspectiveDistortion,
16,(const double *)&cpoints,MagickFalse);
MagickWriteImage(mw,"logo_distort_p.png");
/* Clean up */
if(mw)mw = DestroyMagickWand(mw);
MagickWandTerminus();
}
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.
See my message in this topic for a link to a zip of all the files.