Hi
I need to trim an image but the area I need to trim isn't a single colour so I need to use the fuzz option. It works fine from the command line but I need to be able to do it from Magick++. I've looked at the API and seen that the trim() method doesn't allow you to set a fuzz value and it doesn't seem to take note of the fuzz value set by the colorFuzz() method.
Does anyone have any ideas of how I can achieve this?
Using fuzz in Magick++ trim
Re: Using fuzz in Magick++ trim
Fuzz is supported by Magick::Options::colorFuzz(), Magick::Image::colorFuzz(), and with STL Magick::colorFuzzImage::colorFuzzImage().
Re: Using fuzz in Magick++ trim
Thanks for the response. I am aware that you can set the colorFuzz() value but Magick::Image::trim() does not seem to obey it.
I did the following.
Image.colorFuzz(50);
Image.trim();
But that does not have any effect.
The following from the command line however produces the correct results:
convert image.png -fuzz 50% -trim output.png
Am I doing something wrong?
I did the following.
Image.colorFuzz(50);
Image.trim();
But that does not have any effect.
The following from the command line however produces the correct results:
convert image.png -fuzz 50% -trim output.png
Am I doing something wrong?
Re: Using fuzz in Magick++ trim
The command line option has a percentage argument whereas Magick++ does not. For Magick++ you want colorFuzz(50*QuantumRange/100).
Re: Using fuzz in Magick++ trim
Aha, perfect!
Thanks very much, does the job perfectly
Thanks very much, does the job perfectly