Hello
is it possible with the Magick++ i/f to specify the scale/resize algorithm? The API only provides ::scale() and ::sample()
specifying algorithms for Image::scale()/sample()
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: specifying algorithms for Image::scale()/sample()
I am not an API user, but there should be the equivalent resize() with filter option to the command line -filter xx -resize.
see
http://www.imagemagick.org/Usage/resize/
see
http://www.imagemagick.org/Usage/resize/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: specifying algorithms for Image::scale()/sample()
scale and sample are simply faster varients of specific filters in the resize() operation.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: specifying algorithms for Image::scale()/sample()
Thanks.
After the mention of "filters" I revisited the Image documentation and found[/b] and states:
Will use Image::resize() as suggested and specifying the filter as appropriate as my current usage of scale/sample seems to use no advance filter at all - the documentation:
sample() - Resize image by using pixel sampling algorithm
scale() - Resize image by using simple ratio algorithm
Thanks all.
After the mention of "filters" I revisited the Image documentation and found
Code: Select all
Image::filterType(...)
I am scaling down/resizing photos (portraits) from >4k on longest edge to 1024 or smaller. Using the scale/sample methods the output image makes the people in the images look to have "jaggered" edges."Filter to use when resizing image. The reduction filter employed has a sigificant effect on the time required to resize an image and the resulting quality. The default filter is Lanczos which has been shown to produce high quality results when reducing most images."
Will use Image::resize() as suggested and specifying the filter as appropriate as my current usage of scale/sample seems to use no advance filter at all - the documentation:
sample() - Resize image by using pixel sampling algorithm
scale() - Resize image by using simple ratio algorithm
Thanks all.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: specifying algorithms for Image::scale()/sample()
As I mentioned sample() and scale() are fast non filtered versions of resize()
The documentation does not seem to mention resize() but I am sure it must be their somewhere!
Perhaps under the old (IMv4) terminology of transform()????
This was a function that either resizes or cropped the image based on a string. It is old.
The documentation does not seem to mention resize() but I am sure it must be their somewhere!
Perhaps under the old (IMv4) terminology of transform()????
This was a function that either resizes or cropped the image based on a string. It is old.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/