BoltBait Posted April 24, 2007 Share Posted April 24, 2007 Well, according to Wiki, "conversions here are best described as "nominal". They will produce an invertible conversion between RGB and a subset of CMYK; that is, one can take an RGB color and convert to certain CMYK colors, and from these CMYK colors obtain the corresponding, original RGB equivalents. However, conversion of CMYK colors in general to RGB colors is not invertible; that is, given a CMYK color which is converted to RGB, performing the former conversion may not give the original CMYK color. In addition, CMYK colors may print wildly differently from how the RGB colors display on a monitor. There is no single "good" conversion rule between RGB and CMYK." "Use of four-color printing generates a good final printed result with greater contrast. However, the color seen on a computer screen is often different from the color of the same object on a printout since CMYK and RGB have different gamuts. For example, pure blue (rgb 0, 0, 100%) is impossible to produce in CMYK. The nearest equivalent in CMYK is a dissimilar shade of blue-violet." But, since *you* might find this fun to play with... The Effect DLL Plugin: RGB2CMYK.dll (Updated 4/24/07) Just "save" that DLL file in your C:/Program Files/Paint.net/Effects directory and you should be all set. If you need help installing plugins, read this page: <!-- m -->http://boltbait.googlepages.com/install<!-- m --> Instructions for Use OK, taking this source picture (which I found on the Wiki page): http://boltbait.googlepages.com/CMYK_Before.jpg 1. Open your image. 2. Duplicate it 3 times. You should now have 4 copies. Name them "C", "M", "Y", and "K" respectively. 3. Create a new layer and fill it with white. 4. Move the white layer to the bottom. 5. Select the "C" layer and run the effect. Move the slider to the first position (Cyan) and press OK. 6. Select the "M" layer and run the effect. Move the slider to the second position (Magenta) and press OK. 7. Select the "Y" layer and run the effect. Move the slider to the third position (Yellow) and press OK. 8. Select the "K" layer and run the effect. Move the slider to the last position (blacK) and press OK. Here is the result: http://boltbait.googlepages.com/CMYK_After.jpg Here is the codelab script: #region UICode IntSliderControl Amount1 = 0; // [0,3] Cyan Magenta Yellow blacK IntSliderControl Amount2 = 75; // [0,255] CMY Intensity #endregion // http://en.wikipedia.org/wiki/CMYK_color_model void Render(Surface dst, Surface src, Rectangle rect) { float R=0,G=0,B=0; float C=0,M=0,Y=0,K=0; byte A=0; ColorBgra CurrentPixel; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; // Convert to RGB (float) R = (float)CurrentPixel.R / 255; G = (float)CurrentPixel.G / 255; B = (float)CurrentPixel.B / 255; // Convert to MYC M = 1-G; Y = 1-B; C = 1-R; // Convert to CMYK if ((C==1) && (M==1) && (Y==1)) { C=0;M=0;Y=0;K=1; } else { K=C; if (K > M) K=M; if (K > Y) K=Y; C=(C-K)/(1-K); M=(M-K)/(1-K); Y=(Y-K)/(1-K); } switch(Amount1) { case 0: // Cyan A = (byte)(C*Amount2); R=0;G=255;B=255; break; case 1: // Magenta A = (byte)(M*Amount2); R=255;G=0;B=255; break; case 2: // Yellow A = (byte)(Y*Amount2); R=255;G=255;B=0; break; case 3: // Black A = (byte)(K*255); R=0;G=0;B=0; break; } dst[x,y] = ColorBgra.FromBgra( Int32Util.ClampToByte((int)B), Int32Util.ClampToByte((int)G), Int32Util.ClampToByte((int)R), Int32Util.ClampToByte(A)); } } } This is very rough, I know. Improvements welcome. As always, more information here: <!-- m -->http://boltbait.googlepages.com/cmyk<!-- m --> 😎 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
pyrochild Posted April 24, 2007 Share Posted April 24, 2007 This looks like a lot of fun to play around with Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 24, 2007 Share Posted April 24, 2007 if ((C==1) && (M==1) && (Y==1)) { C=0;M=0;Y=0;K=1; } What about ... if ((C==M) && (M==Y)) { C=0;M=0;Y=0;K=C; } Right now your K channel is a strict black-or-transparent bitmap. Not sure if this works though, I'm just hypothesizing. Oh ... and v3.01?! Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
pyrochild Posted April 24, 2007 Share Posted April 24, 2007 Right now your K channel is a strict black-or-transparent bitmap. erm... you sure about that? @BoltBait: The effect washes out the colors, MOSTLY the blue. Maybe you could tweak it so the C channel is more intense, and it would probably go a long long way towards creating a more accurate conversion. Then again, it might look like bloody potato. I don't know. But it's worth a try yeah? EDIT: PLaying around with the plugin (using the image you show in your example pics), i found that by duplicating the K layer, the image looked sooooo much better. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 24, 2007 Share Posted April 24, 2007 erm... you sure about that? Nope That's why I qualified it with the word hypothesis! Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
pyrochild Posted April 24, 2007 Share Posted April 24, 2007 What about ... if ((C==M) && (M==Y)) { C=0;M=0;Y=0;K=C; } looked exactly the same Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
BoltBait Posted April 24, 2007 Author Share Posted April 24, 2007 @BoltBait: The effect washes out the colors, MOSTLY the blue. Maybe you could tweak it so the C channel is more intense, and it would probably go a long long way towards creating a more accurate conversion.Then again, it might look like bloody potato. I don't know. But it's worth a try yeah? EDIT: PLaying around with the plugin (using the image you show in your example pics), i found that by duplicating the K layer, the image looked sooooo much better. If you read the Wiki article http://en.wikipedia.org/wiki/CMYK_color_model you will see that a perfect conversion is not possible. In fact, you might want to read the discussion page of that article... it is quite entertaining. I just wrote this effect because I wanted to play around with CMYK. BTW, you see in the case statements where I'm multiplying by 75, it should be 255 (according to the algorithm) but I found that to be too strong. I scaled it back to 75 and it looked much better. Of course, this also washes out the colors somewhat. Hmmmm... Maybe I should make that settable. EDIT: Done. Script has 2 sliders now. Oh, and Rick, I just followed the algorithm from the wiki article, I didn't optimize it for speed. I prefer readability during the prototype stage. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
pyrochild Posted April 24, 2007 Share Posted April 24, 2007 ...more accurate conversion. More accurate as in prettier. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
BoltBait Posted April 24, 2007 Author Share Posted April 24, 2007 I just updated the plugin to have 2 sliders now. More tinkering = more fun, right? Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
usedHONDA Posted April 28, 2007 Share Posted April 28, 2007 I should check this forum more often. Let me know when I can add this to the (not released) Plugin Pack. Quote "The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound twtr | dA | tmblr | yt | fb Link to comment Share on other sites More sharing options...
BoltBait Posted April 28, 2007 Author Share Posted April 28, 2007 I should check this forum more often. Let me know when I can add this to the (not released) Plugin Pack. My original permission extends to all of my plugins (except for those noted in my permission statement). Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
usedHONDA Posted April 29, 2007 Share Posted April 29, 2007 Ah, I'll make sure I remember that. Quote "The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Ezra Pound twtr | dA | tmblr | yt | fb Link to comment Share on other sites More sharing options...
Enormator Posted September 15, 2007 Share Posted September 15, 2007 Hey guys! CMYK is subtractive color synthetisis. It can only work with layer blend mode multiply and no usage of alpha. http://en.wikipedia.org/wiki/CMYK_color_model *waiting for new version of the plugin* Quote :Link: website Link to comment Share on other sites More sharing options...
Xarx Posted February 10, 2012 Share Posted February 10, 2012 Hey guys! CMYK is subtractive color synthetisis. It can only work with layer blend mode multiply and no usage of alpha. Yes, this is a very essential information! The plugin author should adment his 8-point "Instructions to use" and add that all the C,M,Y layers must have their layer blend mode set to Multiply (choose a layer and press F4; for the K layer it doesn't matter; This is because the C,M,Y colors are inks, while the black K is a pigment). Then the image composed of all the four layers looks identical to the original image, not so "washed out" as the presented sample result. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.