mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-24 20:14:13 +03:00
Convert CMYK to RGB like Google Chrome
This commit is contained in:
parent
c7136f7ff8
commit
efb0915b19
|
@ -536,12 +536,15 @@ rgb2cmyk(UINT8* out, const UINT8* in, int xsize)
|
||||||
static void
|
static void
|
||||||
cmyk2rgb(UINT8* out, const UINT8* in, int xsize)
|
cmyk2rgb(UINT8* out, const UINT8* in, int xsize)
|
||||||
{
|
{
|
||||||
int x;
|
int x, nk, tmp;
|
||||||
for (x = 0; x < xsize; x++, in += 4) {
|
for (x = 0; x < xsize; x++) {
|
||||||
*out++ = CLIP(255 - (in[0] + in[3]));
|
nk = 255 - in[3];
|
||||||
*out++ = CLIP(255 - (in[1] + in[3]));
|
out[0] = CLIP(nk - MULDIV255(in[0], nk, tmp));
|
||||||
*out++ = CLIP(255 - (in[2] + in[3]));
|
out[1] = CLIP(nk - MULDIV255(in[1], nk, tmp));
|
||||||
*out++ = 255;
|
out[2] = CLIP(nk - MULDIV255(in[2], nk, tmp));
|
||||||
|
out[3] = 255;
|
||||||
|
out += 4;
|
||||||
|
in += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user