You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if DrawAffineImage should be improved to have a better precision. It currently does this:
extent[0].x=0.0;
extent[0].y=0.0;
extent[1].x=(double) source->columns-1.0;
extent[1].y=0.0;
extent[2].x=(double) source->columns-1.0;
extent[2].y=(double) source->rows-1.0;
extent[3].x=0.0;
extent[3].y=(double) source->rows-1.0;
for (i=0; i < 4; i++)
{
PointInfo
point;
point=extent[i];
extent[i].x=point.x*affine->sx+point.y*affine->ry+affine->tx;
extent[i].y=point.x*affine->rx+point.y*affine->sy+affine->ty;
}
min=extent[0];
max=extent[0];
for (i=1; i < 4; i++)
{
if (min.x > extent[i].x)
min.x=extent[i].x;
if (min.y > extent[i].y)
min.y=extent[i].y;
if (max.x < extent[i].x)
max.x=extent[i].x;
if (max.y < extent[i].y)
max.y=extent[i].y;
}
Now imagine applying an affine transform consisting of sx=10 and sy=10 to a 10x10 pixel image. Since DrawAffineImage subtracts 1.0 from the edges before applying the affine transform we'll end up with a max.x and max.y of 90 instead of 100, which is rather imprecise.
Is this a bug or am I missing something here? AFAICT it'd be better to not subtract 1.0 from the right and bottom edges before applying the transform. Then applying a matrix of sx=10 and sy=10 to a 10x10 pixel image would result in a 100x100 image, as expected.
Steps to Reproduce
see above
Images
No response
The text was updated successfully, but these errors were encountered:
ImageMagick version
7.1.0.46
Operating system
Linux
Operating system, version and so on
Ubuntu
Description
I was wondering if
DrawAffineImage
should be improved to have a better precision. It currently does this:Now imagine applying an affine transform consisting of sx=10 and sy=10 to a 10x10 pixel image. Since
DrawAffineImage
subtracts 1.0 from the edges before applying the affine transform we'll end up with amax.x
andmax.y
of 90 instead of 100, which is rather imprecise.Is this a bug or am I missing something here? AFAICT it'd be better to not subtract 1.0 from the right and bottom edges before applying the transform. Then applying a matrix of sx=10 and sy=10 to a 10x10 pixel image would result in a 100x100 image, as expected.
Steps to Reproduce
see above
Images
No response
The text was updated successfully, but these errors were encountered: