New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in quantize()
implementation
#644
Comments
Set from wand.image import Image
with Image(filename="imagedeep.png") as img:
img.quantize(10, measure_error=True)
img.save(filename="imagedeep-wand.png") With the CLI |
Oh wait. This might be something completely different. The input image has colorspace of |
Try the following... from wand.version import MAGICK_VERSION_NUMBER
from wand.image import Image
with Image(filename='imagedeep.png') as img:
if MAGICK_VERSION_NUMBER < 0x700:
img.quantize(10, colorspace_type='undefined')
else:
img.quantize(10, colorspace_type='undefined', dither='undefined')
img.save(filename='imagedeep-wand.png') Please post if that works (with or without |
It works properly with |
Cool. I'll have this patch up shortly. |
I was investigating a bug in my app affecting a specific image that would become fully transparent after applying effects using Wand. After some testing, I found that
quantize()
method was making this issue.I've tested it with different colorspaces, and it appears that setting the colorspace to
gray
fixes this issue. This isn't ideal, as my app also supports color images, and I would have to manually detect if image is grayscale or RGB, whereas it appears that ImageMagick doesn't have this issue and can automatically detect it.I tested quantization in ImageMagick CLI and Magick++, and couldn't reproduce this issue in either of them.
Minimal Wand reproducer:
Tested ImageMagick CLI command:
Tested C++ code:
Affected image:
The text was updated successfully, but these errors were encountered: