Leaderboard


Popular Content

Showing content with the highest reputation on 07/02/2020 in all areas

  1. 5 points
  2. 3 points
    Back with my second plugin. This time I made a plugin that can be used to easily and quickly create a gradient mapping effect using 2 colors. I know pyrochild already made a gradient mapping tool, but this is just a simplified version using only 2 colors for dark and light tones. I added some options for post processing as well, like contrast and blending mode. Download: DuotoneGradientMap.zip Preview: Code: (I’m still a beginner in C#, please don’t hurt me) // Name: Duotone Gradient Map // Submenu: Color // Author: Pascal // Title: Duotone Gradient Map // Version: 1.0 // Desc: Easy and quick way of gradient mapping // Keywords: // URL: // Help: #region UICode ColorWheelControl Amount1 = ColorBgra.FromBgr(0, 0, 0); // Dark ColorWheelControl Amount2 = ColorBgra.FromBgr(255, 255, 255); // Light IntSliderControl Amount3 = 100; // [0,100] Amount IntSliderControl Amount4 = 0; // [0,1000] Contrast ListBoxControl Amount5 = 0; // Blending mode|Normal|Multiply|Darken|Lighten|Additive #endregion void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra Primary = Amount1; ColorBgra Secondary = Amount2; ColorBgra Cp; //current pixel ColorBgra Np; //new pixel for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { Cp = src[x,y]; //control parameters double A = ((double)Amount3)/100; //amount double C = (double)Amount4; //contrast int M = Amount5; //blending mode //get rgb double R = Cp.R; double G = Cp.G; double B = Cp.B; //value double P = ((R+G+B)/3)/255; //luminosity //get colors double Rp = Primary.R; double Rs = Secondary.R; double Gp = Primary.G; double Gs = Secondary.G; double Bp = Primary.B; double Bs = Secondary.B; //calculate new color R = Norm((P*Rs + (1-P)*Rp)*A + (1-A)*R, 255); G = Norm((P*Gs + (1-P)*Gp)*A + (1-A)*G, 255); B = Norm((P*Bs + (1-P)*Bp)*A + (1-A)*B, 255); //apply new color and contrast Np = ColorBgra.FromBgra( (byte)Norm(Con(B, C), 255), (byte)Norm(Con(G, C), 255), (byte)Norm(Con(R, C), 255), Cp.A); //BLENDING MODES //multiply if(M == 1){ Cp.R = (byte)Norm((Cp.R * Np.R/255)*A + Cp.R*(1-A), 255); Cp.G = (byte)Norm((Cp.G * Np.G/255)*A + Cp.G*(1-A), 255); Cp.B = (byte)Norm((Cp.B * Np.B/255)*A + Cp.B*(1-A), 255); } //darken else if(M == 2){ if(Np.R < Cp.R){ Cp.R = Np.R; } if(Np.G < Cp.G){ Cp.G = Np.G; } if(Np.B < Cp.B){ Cp.B = Np.B; } } //lighten else if(M == 3){ if(Np.R > Cp.R){ Cp.R = Np.R; } if(Np.G > Cp.G){ Cp.G = Np.G; } if(Np.B > Cp.B){ Cp.B = Np.B; } } //additive else if(M == 4){ Cp.R = (byte)Norm(Cp.R + Np.R*A, 255); Cp.G = (byte)Norm(Cp.G + Np.G*A, 255); Cp.B = (byte)Norm(Cp.B + Np.B*A, 255); } //normal else{ Cp = Np; } dst[x,y] = Cp; } } } //normalize double Norm(double x, int i){ if(x > i){ x = i; } if(x < 0){ x = 0; } return x; } //contrast double Con(double x, double c){ x /= 255; double y; if(x <= 0.5){ y = 0.5 * Math.Pow(2*x, (c/500)+1); } else{ y = 1 - 0.5 * Math.Pow(2 - 2*x, (c/500)+1); } return y*255; }
  3. 3 points
  4. 3 points
  5. 2 points
  6. 2 points
    Using an enum is even cleaner. #region UICode ListBoxControl<BlendingMode> blendingMode = 0; // Blending mode|Normal|Multiply|Darken|Lighten|Additive #endregion enum BlendingMode { Normal, Multiply, Darken, Lighten, Additive } void Render(Surface dst, Surface src, Rectangle rect) { switch (blendingMode) { case BlendingMode.Multiply: // code here break; case BlendingMode.Darken: // code here break; case BlendingMode.Lighten: // code here break; case BlendingMode.Additive: // code here break; case BlendingMode.Normal: default: // code here break; } }
  7. 2 points
  8. 1 point
    I made my first plugin using CodeLab. It can be used to simulate different types of colorblindness. I always liked the tritanopia effect, but couldn’t find a plugin for it online, so I just made it myself. It is not scientifically accurate, but it comes very close. My source code is a mess, so I won’t share it. I hope you like it. Download: Colorblindness2.zip Can be found in Effects > Color > Colorblindness Demo: Interface:
  9. 1 point
    ❤️ Dear @Pixey! Beautiful, sweetness colors. Thank you so much.
  10. 1 point
    Thank you very much @welshblue and @lynxster4 & @Seerose for the kind words On reflection I think it's a bit 'trippy" as well 🤣 Many thanks @LionsDragon for the Rep
  11. 1 point
    I don't know if I understood exactly what you want... Your image has a white background. To outline the letter F with text in it, you need to remove the background. To do this, choose the Magic Wand tool and set the Tolerance to zero. Click in the white area outside of the F then Cut. You can now use the Outline Object plugin.
  12. 1 point
    Bus driver now change of vehicle
  13. 1 point
    Beautiful abstract @Pixey! Reminds me of a beating heart, emanating love... 😀
  14. 1 point
    July Update A couple of new plugins this month and with these we welcome a brand new plugin author, pascal, to our stable of cool PDN users :B Colorblindness Simulation pascal Simulate different types of colorblindness including tritanopia. Comes with *.bat installer. Slight Edge Boost loupasc Enhances image edges using unsharp mask method. Also apply sharpen only to the image luminosity in order to avoid chromatic noise amplification. Of note is this months update of CodeLab to version 6. BoltBait and toe_head2001 have overhauled our favorite code tool to make it even more awesome. Go check it out!
  15. 1 point
    Oh yeah ... I love that. A paradox of ethereal and tangible. One of those images to look at and see different things depending on the mood. Beautiful
  16. 1 point
    Thank you @Seerose It's so nice to have you back Something a bit different for a change. Made using the Plugins; Twist, Radial Blur and Jitter. Hope you like it 😀
  17. 1 point