mono / libgdiplus

C-based implementation of the GDI+ API
http://www.mono-project.com/
MIT License
329 stars 171 forks source link

Fix ISSUE #706 The color of CMYK pixel format pictures is incorrect. #707

Open e8-ShiWei opened 3 years ago

e8-ShiWei commented 3 years ago

Values of b and r are incorrect. Red is assigned to b, and blue is assigned to r.

Swap the positions of b and r. Fix to:

r = (255 - k) * (255 - c) / 255;
g = (255 - k) * (255 - m) / 255;
b = (255 - k) * (255 - y) / 255;

Example, red: C = 0% M = 100% Y = 100% K = 0%

=>

R = 255 255 / 255 = 255 G = 255 0 / 255 = 0 B = 255 * 0 / 255 = 0

e8-ShiWei commented 3 years ago

Hi, any update? When will we get a release version containing this modification? If it takes a long time to release a new version, we may need to compile this library ourselves. Thanks.

filipnavara commented 3 years ago

Usually the release cadence of this library is quite slow. @akoeplinger, can you look at this PR / approve it?