Jump to content

BoltBait

Administrator
  • Posts

    15,651
  • Joined

  • Last visited

  • Days Won

    390

Everything posted by BoltBait

  1. Try the menu Windows > Reset windows locations
  2. Hey, I don't have to learn a lesson more than once.
  3. User bugman was asking about a different type of gradient... so I coded it up! I also remember someone asking about gradients that had dithering built in. So, I included that. Also, since I really love HSV gradients, I included that too! GradientTest.zip Enjoy. Obviously it still needs a lot of polish to finish it. But, hopefully some people will find it useful even in its unfinished state. Here is the CodeLab script: // Author: BoltBait // Submenu: Render // Name: Gradients // Title: BoltBait's Gradient Test // URL: http://www.BoltBait.com/pdn #region UICode byte Amount1 = 0; // Method|RGB|HSV byte Amount2 = 0; // Direction|Vertical|Horizontal ColorBgra Amount3 = ColorBgra.FromBgr(0,0,0); // From ColorBgra Amount4 = ColorBgra.FromBgr(255,255,255); // To bool Amount5 = true; // [0,1] Dither #endregion private byte Clamp2Byte(float fValue) { if (fValue<0) return 0; if (fValue>255) return 255; return (byte)fValue; } private byte Clamp2100(float fValue) { if (fValue<0) return 0; if (fValue>100) return 100; return (byte)fValue; } public int Clamp2360(float MyAngle) { // Makes sure that 0.0 <= MyAngle < 360.0 if (MyAngle >= 360.0) { MyAngle -= (float)(Math.Floor((double)MyAngle / 360.0) * 360.0); } if (MyAngle < 0.0) { MyAngle += (float)360.0; } return (int)MyAngle; } Random R = new Random(); void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); float v1,v2,v3; float f1,f2,f3; float t1,t2,t3; float d1,d2,d3; float maxd, d, a; HsvColor hsv; // Calculate the maximum size of the fade if (Amount2==0) { maxd = selection.Bottom - selection.Top; } else { maxd = selection.Right - selection.Left; } // Select the starting and ending color of the fade if (Amount1==0) // RGB { f1 = Amount3.R; f2 = Amount3.G; f3 = Amount3.B; t1 = Amount4.R; t2 = Amount4.G; t3 = Amount4.B; } else // HSV { hsv = HsvColor.FromColor(Amount3.ToColor()); f1 = hsv.Hue; f2 = hsv.Saturation; f3 = hsv.Value; hsv = HsvColor.FromColor(Amount4.ToColor()); t1 = hsv.Hue; t2 = hsv.Saturation; t3 = hsv.Value; // is the shortest path crossing the 0 barrier? if (Math.Abs(f1 - t1) > (360-Math.Max(f1,t1)+Math.Min(f1,t1))) { // wrap ending color if (f1 > t1) { t1 += 360; } else { t1 = -360 + t1; } } } ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; // dithering? int adj = 0; if (Amount5) { adj = R.Next(-1,2); } // calculate current pixel distance if (Amount2==0) // Vertical { d = (180 * (((y+adj)+adj) - selection.Top)) / maxd; } else // Horizontal { d = (180 * (((x+adj)+adj) - selection.Left)) / maxd; } // calculate percentage of adjustment a = (float)(Math.Cos(d * (Math.PI/180)) + 1) / 2; // calculate adjustment from first color d1 = (t1 - f1) * a; d2 = (t2 - f2) * a; d3 = (t3 - f3) * a; // calculate current color v1 = f1 + d1; v2 = f2 + d2; v3 = f3 + d3; // recombine into a color if (Amount1 == 0) { CurrentPixel.R = Clamp2Byte(v1); CurrentPixel.G = Clamp2Byte(v2); CurrentPixel.B = Clamp2Byte(v3); } else { hsv = new HsvColor(Clamp2360(v1),Clamp2100(v2),(int)v3); CurrentPixel = ColorBgra.FromColor(hsv.ToColor()); } // make opaque CurrentPixel.A = (byte)255; // show it dst[x,y] = CurrentPixel; } } } I think the from and to colors may be switched. Sorry about that.
  4. Rick has stated in the past that he will not be adding reeditable vector shapes. Once a shape is finalized it will become part of the raster image. HOWEVER, he did say that at some point text layers will be added. This would be reeditable text.
  5. Locking this thread. You may only have one thread in the Pictorium. If you have more art to display, either edit your original topic or post a response to that thread.
  6. Locking this thread. You may only have one thread in the Pictorium. If you have more art to display, either edit your original topic or post a response to that thread.
  7. After you master some of the simple tutorials, you'll want to learn how to install plugins. Plugins extend the functionality of Paint.NET by adding new Effects, Adjustments, and file types. Here is a page I wrote that explains how to install plugins: Installing Paint.NET plugins. You can find more plugins here: http://www.getpaint.net/redirect/plugins.html
  8. Remember, you can always click on the specific step in the list where you want to go.
  9. You can shrink your main PdN window slightly then put the tool windows outside of the working canvas.
  10. If you need to give someone a picture, do it on someone elses site. Try Photobucket or another photo sharing site. It doesn't belong here.
  11. The plugin pack attached to the first post on this thread has an updated plugin pack that includes an older version of outline.dll that includes a colorwheel. Sorry for the confusion. Download and install again and this time, make sure to overwrite all files in your Paint.NET effects folder with the ones included here.
  12. You have to scan it with a QR reader on a smart phone. It should take you to a web site.
  13. Go up to your first post and click the "edit" button.
  14. My latest creation: I call it, "Trapped in the Machine". Enjoy.
  15. Paint.NET does not support CMYK. You really need to use Photoshop for this.
  16. That function of our board has been disabled. Sorry for the inaccurate error message.
  17. Plugins only slow down the initial loading of Paint.NET. They don't slow down the normal operation of Paint.NET.
  18. Please read the forum rules (specifically 7 and 8): Your best bet is to figure out how to install SP3. That is not a Paint.NET question so we can not help you with that here. You might want to try a Windows help forum. Closed.
  19. Read this: http://forums.getpaint.net/index.php?/topic/9349-
  20. Try the Recolor tool: http://www.getpaint.net/doc/latest/RecolorTool.html Or, if you're looking for something a little more automatic, try: http://forums.getpaint.net/index.php?/topic/13003- Conditional Hue/Saturation plugin. It is a little tricky to learn, but very powerful.
×
×
  • Create New...