Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #7309

Adds a CMYK to RGB unpacker, essentially copying the code from

static void
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize) {
int x, nk, tmp;
for (x = 0; x < xsize; x++) {
nk = 255 - in[3];
out[0] = CLIP8(nk - MULDIV255(in[0], nk, tmp));
out[1] = CLIP8(nk - MULDIV255(in[1], nk, tmp));
out[2] = CLIP8(nk - MULDIV255(in[2], nk, tmp));
out[3] = 255;
out += 4;
in += 4;
}
}

@hugovk
Copy link
Member

hugovk commented Oct 5, 2023

essentially copying the code from ...

Is it worth de-duplicating, and having them both calling a common function?

@radarhere
Copy link
Member Author

Ok, I've pushed a commit to include the Convert function in Unpack.

@hugovk hugovk merged commit 5957f10 into python-pillow:main Oct 6, 2023
@radarhere radarhere deleted the cmyk2rgb branch October 6, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add capability to process CMYK palettes

3 participants