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 »

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: 12159
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 »

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 »

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: 1570
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 »

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