How can I set the interpolation method when I resize the image?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
ichaozai
Posts: 3
Joined: 2014-12-01T23:34:35-07:00
Authentication code: 6789

How can I set the interpolation method when I resize the image?

Post by ichaozai » 2014-12-01T23:47:58-07:00

I see there is an option "interpolate" for utility "convert" to specify the interpolation method.

I want to resize the image with the bilinear or other algorithm in my own program, but I can't find any API to do this with Magick++ C++ library.

How can I set the interpolation method when I resize the image?

snibgo
Posts: 12283
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How can I set the interpolation method when I resize the image?

Post by snibgo » 2014-12-02T00:22:34-07:00

I don't use Magick++, but perhaps the answer is to set image->interpolate to the required value, such as BilinearInterpolatePixel.

See magick\image.h and magick\pixel.h
snibgo's IM pages: im.snibgo.com

ichaozai
Posts: 3
Joined: 2014-12-01T23:34:35-07:00
Authentication code: 6789

Re: How can I set the interpolation method when I resize the image?

Post by ichaozai » 2014-12-03T00:17:32-07:00

The internal core image struct is opaque to the caller of Magick++, I can't set core image struct's attribute directly.

Finally, I dig into the source code and add a setter function to manipulate the core image sturct for C++ class Magick++::Image to set the interpolation method.

User avatar
dlemstra
Posts: 1576
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: How can I set the interpolation method when I resize the image?

Post by dlemstra » 2014-12-03T06:14:17-07:00

Can you post your changes? I can add it to Magick++ when I am back from my holiday
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Post Reply