Hello,
I found that it is impossible to apply affine transform on image with interpolation (filter).
Following code runs forever.
Magick::Image *bitmap_;
MagickLib::Image *resized_;
MagickLib::AffineMatrix _affine;
_affine.sx = 0.1; _affine.rx = 0; _affine.tx = 0;
_affine.sy = 0.1; _affine.ry = 0; _affine.ty = 0;
bitmap_->image()->filter = MagickLib::BoxFilter;
bitmap_->image()->interpolate = MagickLib::FilterInterpolatePixel;
resized_ = MagickLib::AffineTransformImage( bitmap_->image(), &_affine, NULL);
Following code produces non-Bicubic interpolated result:
MagickLib::AffineMatrix _affine;
_affine.sx = 0.1; _affine.rx = 0; _affine.tx = 0;
_affine.sy = 0.1; _affine.ry = 0; _affine.ty = 0;
bitmap_->image()->interpolate = MagickLib::BicubicInterpolatePixel;
resized_ = MagickLib::AffineTransformImage( bitmap_->image(), &_affine, NULL);
How interpolation can be set for affine transform?
AffineTransformImage + interpolate
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: AffineTransformImage + interpolate
You could switch to using the DistortImages AffineProjection method instead. This should have a lot more control.
The older affine functions has not been modified to use the new more general distortion method as yet.
The older affine functions has not been modified to use the new more general distortion method as yet.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/