Jump to content

BoltBait

Administrator
  • Posts

    15,653
  • Joined

  • Last visited

  • Days Won

    390

Everything posted by BoltBait

  1. This can already be done. Just select an area and use the right mouse button on the "handles" that appear around your selection when you use the Move Selected Pixels tool.
  2. Try this: Once you draw a line, use the right mouse button on the middle two nubs. It turns the line into a bezier curve. When you learn how to control a bezier curve you will be much happier.
  3. Cool. All I need to do is upgrade my compiler from 2003 to 2005 and I'll be all set. Thanks!
  4. Yes, after step 3 there is a big white space in the center of my drawing... So I added 3 quarters to the picture to finish it off.
  5. What is the hardest part of creating seamless textures? Yes, making sure they look natural when they repeat. The usual problem is that no matter how hard you try, the seam is usually clearly visible. I thought that it may make it easier if you work on the edges first (in the middle of the canvas), then move them to the edges of the physical canvas. I know this probably sounds strange, but just take a look at the instructions section below for a better explanation. You can download the precompiled effect DLL here: SeamlessHelper.dll Just drop this file in your /program files/Paint.NET/effects directory and you should be all set. Instructions for Use The best way to use this is to follow these steps: 1) Create a canvas that is an even width and even height. For example, 200 x 200. It is critical that you do not use odd dimensions--they can be different (like 200x100, etc.) just not odd. 2) Start creating your texture by focusing on the middle of the canvas. Do not place anything too close to the edges at this point. I will be creating a repeating texture of American coins. Here you can see this step: http://boltbait.googlepages.com/Coins1.jpg Notice that I am only concerned about covering the area marked in red. Do not include red lines, they are only here to illustrate the area that I'm trying to cover. By the way, I found all the images of these coins by using Google Image Search. I made this composite image by using several layers and liberal use of the Feather plugin. 3) Flatten your image down to a single layer. 4) Run the Seamless Helper effect. Your image should now look like this: http://boltbait.googlepages.com/Coins2.jpg Notice how the coins have been moved to the edges. Your texture now has seamless edges! To illustrate this more simply, take a look at this image (before on left, after on right): http://boltbait.googlepages.com/Coins4.gif The effect DLL basically splits your image into 4 parts and rearranges those parts as show above. 5) Now finish off the center of the image being careful to again stay away from the edges. I'll just add 3 quarters to the picture: http://boltbait.googlepages.com/Coins3.jpg 6) Save the file in your favorite format (GIF, JPG, or PNG). That's it! You have created a seamless texture! You can quickly test these by putting it on your desktop and chose the "tile" option. Once you've made a seamless texture, the next thing you'll need is the photo flood fill plugin. 😎 Source Code The codelab script is fairly straight forward: void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.SelectionBounds; int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left; int CenterY = ((selection.Bottom - selection.Top) / 2) + selection.Top; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { srcX = x; srcY = y; if (x < CenterX) { srcX += CenterX; } else { srcX -= CenterX; } if (y < CenterY) { srcY += CenterY; } else { srcY -= CenterY; } dst[x,y] = src[srcX,srcY]; } } }
  6. Madjik, while clearly fascinating, how do you predict what will happen when you adjust the various inputs? In other words, in the original final script, you can clearly guess that when you change verticies from 5 to 6, you can guess that you will go from drawing a pentagon to a hexagon. In yours, increasing verticies makes the curves smoother. But, what is coefficient a, b, and c? What do they 'mean'? Oh, and to answer your question about line width... Getting the specified line width from the UI is easy: int LineWidth = (int)EnvironmentParameters.BrushWidth; As for how to modify my line drawing routine to take advantage of it (AND antialias the resulting line), now that's another story.
  7. ...Sadly, I do this sometimes, hehe. You're doing it now. Stop that! Go edit more screenshots into your LiteBrite tutorial...
  8. Nice! If you had a few more screenshots of the canvas between step 9 and 14 I would sticky this one. (people need to know they're on the right track)
  9. Once you "finalize" a block of text you can not edit it again--it is a graphic. By "finalize" I mean click away from it. This is why it is usually best to keep text on its own layer. If you need to "edit" it, you can just recreate the layer.
  10. This is an easy question. I use the Codelab effect 10x more often than any other plugin.
  11. Yeah, but your lightyears ahead of me. That may be... but that still doesn't mean I can do what you want.
  12. If only there was a tutorial on the basics of changing a codelab script (with an input or two) into an effect DLL. I don't even know where to begin. Besides the compiler (which one?) what else do I need on the system in order to make an Effect DLL? What kind of project should it be? etc. I know my questions sound pretty basic, but all the C# coding I do is for the web.
  13. Heh. Don't ask me to write an effect... I'm terrible at it. And, the worst part about it, if I did write one, I wouldn't know how to put a UI on it.
  14. Sorry, but, honestly, I don't understand what you're asking for. You want to "change your pictures into a grid"... what exactly are you asking here? Perhaps if you could give us an example of what you're talking about we could help. And, what is "Pro Evolution Soccer"? Is this a computer game? Or...
  15. Next semester, I will be teaching a class to highschool students on Digital Photo Manipulation and Graphs Creation using Paint.NET 3.0 and all the effects DLL's that I can find.
  16. That actually may be possible. The original script I wrote was not treating alpha values properly. After Rick pointed that out, I updated the script and published the results on my googlepages. However, I never went back here and updated the screenshots. Well, today I updated the screenshots on this thread.
  17. Well, you'll need to host your pictures somewhere. Go over to http://www.photobucket.com and create an account. Upload your pictures there. Once you upload the pictures, photobucket will give you the UBB code you need for displaying your picture on this message board. The code is in the bottom box under the picture. As trickman said, it looks something like this: [img]http://www.photobucket.com/album/picture.jpg[/img]
  18. BTW, here is the palette I usually use: http://paintdotnet.12.forumer.com/viewtopic.php?t=2103 Note: if you copy that one off the thread and try to make a palette file out of it, you need to delete the extra space off the end of each line or it won't work. I use a program called metapad.exe which will do that for you. Rick, I sure wish your reader would strip off white space from each line before parsing the ARGB values.
  19. You can edit the palette manually by clicking on the little folder in the color docker and choosing "Open Palettes Folder". You can then use Notepad to manually edit the palette files. It's not quite a walk in the park, but you can rearrange colors, add specific colors, etc.
  20. Maybe you should take some asprin. I'm not sure what you mean. Could you show a screenshot?
  21. OK, so, taking Madjik's idea (then fixing it)... Here is the updated Codelab script: void Render(Surface dst, Surface src, Rectangle rect) { int rpercent = 95; // percent of radius (1-100), default 100, slider int verticies = 5; // number of points (3-10?), default 5, slider int rotation = 15; // degrees to rotate the shape (0-359), default 0, slider int stars = 1; // 1=normal, 2=stars (integer, range 1 to less than verticies/2) PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); // Because I have to reset the destination every time // this is reeeeeaaaaallllly slow for(int y = rect.Top; y { for (int x = rect.Left; x { if (selectionRegion.IsVisible(x, y)) { dst[x,y] = src[x,y]; } } } // If this was a tool, this is where the starting nub is located long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left); long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top); // calculate actual radius // If this was a tool, you should calculate this from the second nub location double r = (double)(Math.Min(CenterX-selection.Left,CenterY-selection.Top)/100.0*rpercent); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; // for 2.72 use .ForeColor; ColorBgra CurrentPixel; double th = 360.0/verticies; double X1 = 0, Y1 = 0, X2 = 0, Y2 = 0; double angle = 0; for (int P = 0; P { // Find the starting point (X1,Y1) angle = Math.PI * ((th * P) + rotation) / 180.0; X1 = (r * Math.Cos(angle)) + CenterX; Y1 = (r * Math.Sin(angle)) + CenterY; // Find next end point (X2,Y2) angle = Math.PI * ((th * (P+stars)) + rotation) / 180.0; X2 = (r * Math.Cos(angle)) + CenterX; Y2 = (r * Math.Sin(angle)) + CenterY; // Draw line from (X1,Y1) to (X2,Y2) DrawLine((int)X1,(int)Y1,(int)X2,(int)Y2, dst, PrimaryColor, selectionRegion); } } void DrawLine(int x1, int y1, int x2, int y2, Surface dst, ColorBgra LineColor, PdnRegion selectionRegion) { int i,gd,gm; double roundx,roundy,xi,yi,dx,dy,x,y,l; dx=x2-x1; dy=y2-y1; if(Math.Abs(dx)>Math.Abs(dy)) { l=dx; } else { l=dy; } if (l { DrawLine(x2,y2,x1,y1,dst,LineColor,selectionRegion); } else { xi=dx/l; yi=dy/l; x=x1; y=y1; if (selectionRegion.IsVisible((int)x, (int)y)) { dst[(int)x, (int)y] = LineColor; } for(i=1;i { x=x+xi; y=y+yi; roundx=x+0.5; roundy=y+0.5; if (selectionRegion.IsVisible((int)roundx, (int)roundy)) { dst[(int)roundx, (int)roundy] = LineColor; } } } } Here are some examples of stars you can create: Now, who will put a UI on this?
  22. This forum is for Plugin publishing, not plugin requests... moving... Paint.NET 3.0 Alpha 3 pretty much has that capability already. Just run the new Outline effect followed by the Black and White Adjustment.
×
×
  • Create New...