CodingTrain / CodingTrain/Suggestion-Box
color composition
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I a beginner and I have seen your dithering coding challenge. Really impressive how fast you code. This challenge is also to reduce the amount of image's colors
Here is my idea:
I have a range of non primaries CMYK colors. ex:
Color A (0, 81, 76, 16)
Color B (100, 45, 0, 22)
Color C (100, 0, 53, 21)
Color D (0, 21, 91, 0)
Color E (100, 15, 0, 21)
Color F (black) (0, 9, 16, 82)
Color H (white) (0, 0, 0, 6)
Color I (gray) (0, 1, 3, 41)
Imagine a pixel with a specific color called Colorpix (C, M, Y, K).
I would like to determine de Colorpix composition to give a result like:
Colorpix (+/- T) = 6% Color A + 40% color D....etc... with the minimum of colors.
We could include a tolerance factor T.
I think first we could solve the problem for dark black and clear white:
**for black:**
If K>82 // the K value of the black
then Colorpix = Color F // (black)
**for white:**
if K<6, and C,M,Y < 7 // 7 is an arbitrary value
then Colorpix = Color H // (white)
**For gray,**
If K > 41 it is much better to use % of Black
If 6 < K < 41it is much better to use % of Gray
for the proportional value of our color palette it is also simple.
but for the rest it becomes very difficult to me to solve that.
Is it a good challenge for you?
Many thanks for your tutorials and I expect you are fine.
Best regards
Romain
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.