Page 1 of 1

[RESOLVED]vignette offsets x and y

Posted: 2013-11-07T13:50:01-07:00
by fmw42
I was experimenting with -vignette to see what the x and y offsets do, so that I could modify the documentation.

They would appear to change the radius of the base ellipse for the vignette before applying the blur. From the code of vignetteImage, at about line 5492:

Code: Select all

  (void) FormatLocaleString(ellipse,MaxTextExtent,
    "ellipse %g,%g,%g,%g,0.0,360.0",image->columns/2.0,
    image->rows/2.0,image->columns/2.0-x,image->rows/2.0-y);
But I cannot find the default values for x and y. They are not zero as demonstrated by the following. And they do not appear to be either a fixed amount in either pixels or percent. For the size 200x200, either 20 pixel or 20%x100 radius = 20 pixels and both match the default. But at 400x400 neither 20 pixels nor 20% seem to match. Perhaps the percent is not working correctly, since both 20 pixels and 20% give the same result (but do not match the default except at 200x200)

convert -size 200x200 xc:black -vignette 0x0 -negate circle_defaultoffsets.jpg
Image

convert -size 200x200 xc:black -vignette 0x0+0+0 -negate circle_zerooffsets.jpg
Image


Can someone tell me what the default x and y values are? I know they must be positive so that the circle is made smaller

Re: vignette offsets x and y

Posted: 2013-11-30T20:00:56-07:00
by fmw42
I found it. It is 10% of the width and 10% of the height of the image.

Code: Select all

      if ((flags & XiValue) == 0)
        geometry_info.xi=0.1*(*image)->columns;
      if ((flags & PsiValue) == 0)
        geometry_info.psi=0.1*(*image)->rows;