Wrong colors when drawing on YCbCr images
Posted: 2008-03-11T19:53:14-07:00
Hi!
From this bugs report on Debian http://bugs.debian.org/462895:
Tested with ImageMagick 6.3.7-9
Thank you!
Best regards,
Nelson
From this bugs report on Debian http://bugs.debian.org/462895:
Code: Select all
Hi,
Image::Magick (and probably ImageMagick proper) seems rather broken when
working in non-RGB colorspaces. Witness for instance the following
script:
use Image::Magick;
my $m = Image::Magick->new(size=>"200x200");
$m->Read("xc:green");
$m->Set(colorspace=>'YCbCr');
$m->Draw(primitive=>"rectangle", fill=>"white", points=>"0,0 100,100");
$m->Write("test.jpeg");
The resulting background is correctly enough green (showing that the
colorspace conversion worked), but the square is pink. This is because
#ffffff in YCbCr is, of course, pink, not white.
I can work around this to some degree, by giving explicit hex codes
to Draw() instead of color names. However, I cannot find a reasonable
way of drawing FreeType text, since drawing black text on a white
background yields ugly green fringes where there should have been grey
pixels (ie. the antialiasing doesn't understand YCbCr either).
Thank you!
Best regards,
Nelson