BoltBait Posted November 15, 2006 Share Posted November 15, 2006 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: 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: 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): 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: 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. 8) Source Code The codelab script is fairly straight forward: void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2)+selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2)+selection.Top); ColorBgra CurrentPixel; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { if (selectionRegion.IsVisible(x, y)) { 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]; } } } } Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
barkbark00 Posted November 15, 2006 Share Posted November 15, 2006 I could see this being very helpful Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
TinSoldier Posted November 15, 2006 Share Posted November 15, 2006 I don't understand step 4 very well; you just added some more coins to your image on different layers? Is that correct? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted November 15, 2006 Author Share Posted November 15, 2006 I don't understand step 4 very well; you just added some more coins to your image on different layers? Is that correct? 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. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
crazyasslatino Posted November 20, 2006 Share Posted November 20, 2006 thank god u made this! i always wanted something to make a tile background but never comes out right Quote Link to comment Share on other sites More sharing options...
kirby145 Posted December 4, 2006 Share Posted December 4, 2006 Wow how did you do that it's like magic Quote "By trying to reinvent the wheel every time we find very often with square wheels" ...X-blaster Link to comment Share on other sites More sharing options...
MadJik Posted December 4, 2006 Share Posted December 4, 2006 Madjik would have say : logic! Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
shaun1ee Posted April 5, 2007 Share Posted April 5, 2007 Not to worry, I managed to sort it Thanks MadJik for the reply anyway Quote Link to comment Share on other sites More sharing options...
Enormator Posted April 21, 2007 Share Posted April 21, 2007 WOW I'm proud of me... and you biiig thanx dude! (Made this pic only with effects (like noise, median blur, emboss... and YOUR EFFECT)) I also got a better one but didn't find it on my hdd. I'll add it later... maybe :wink: Quote :Link: website Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 http://paintdotnet.12.forumer.com/viewtopic.php?p=48707#48707 From a request/idea on another topic... To make a texture at once, I make an average with Source+Destination. Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; 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; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f); PixD.G = (byte)((float)(Pix1.G + Pix2.G + 0.5f)/2.0f); PixD.B = (byte)((float)(Pix1.B + Pix2.B + 0.5f)/2.0f); PixD.A = (byte)((float)(Pix1.A + Pix2.A + 0.5f)/2.0f); dst[x,y] = PixD; } } } Edit: correction of a bug :oops: Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 http://paintdotnet.12.forumer.com/viewtopic.php?p=48707#48707 From a request/idea on another topic... To make a texture at once, I make an average with Source+Destination. Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; 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; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f); PixD.G = (byte)((float)(Pix1.G + Pix2.G + 0.5f)/2.0f); PixD.B = (byte)((float)(Pix1.B + Pix2.B + 0.5f)/2.0f); PixD.A = (byte)((float)(Pix1.A + Pix2.A + 0.5f)/2.0f); dst[x,y] = PixD; } } } Edit: correction of a bug :oops: Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 When I run that I get the following error: Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 When I run that I get the following error: Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 When I run that I get the following error: I've changed this line so often, but I forgot to update the post! Done! TY Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 When I run that I get the following error: I've changed this line so often, but I forgot to update the post! Done! TY Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 20, 2007 Share Posted June 20, 2007 Seamless texture Maker http://paintdotnet.12.forumer.com/viewtopic.php?t=5334 Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
R3VENGE Posted January 1, 2008 Share Posted January 1, 2008 this will help in my ut2k4 map textures. before i had pdn i just used paint and everything was out of place. now i can put it into line Quote psn id: R3V-fiR3 Link to comment Share on other sites More sharing options...
jimjimmy1995 Posted January 21, 2011 Share Posted January 21, 2011 I've been doing this manually grr this makes life easier. Quote Link to comment Share on other sites More sharing options...
heartofdestany Posted April 3, 2014 Share Posted April 3, 2014 One question, Where in the menus is the option to use this? I installed the plugin but can't find where it is accessed in order to use it. Any help here would be most appreciated, thank you in advance. Quote Link to comment Share on other sites More sharing options...
sashwilko Posted April 3, 2014 Share Posted April 3, 2014 (edited) One question, Where in the menus is the option to use this? I installed the plugin but can't find where it is accessed in order to use it. Any help here would be most appreciated, thank you in advance. You will find it in the Effects menu, just scroll down after clicking the Effects tab Edited April 3, 2014 by sashwilko Quote Link to comment Share on other sites More sharing options...
dustinechoes849 Posted April 7, 2016 Share Posted April 7, 2016 This is friggin' magic. Thanks! Quote Link to comment Share on other sites More sharing options...
sunmaggot Posted September 23, 2017 Share Posted September 23, 2017 Spent 1 hour to create this. I used the plugin to create different tiles that can link together in all combinations. The grid is so subtle that it is almost hidden!! Thank you very much for the plugin!!! 1 Quote 道生一,一生二,二生三,三生萬物。 non-existence made one, one made two, two made three, three made matters. 道可道,非常道;名可名,非常名。 well-defined principles are not eternal principles, names that can be named are not eternal names. Link to comment Share on other sites More sharing options...
LionsDragon Posted September 23, 2017 Share Posted September 23, 2017 @sunmaggot, wow, it looks like panne velvet! Excellent use of the plugin! Quote Link to comment Share on other sites More sharing options...
sunmaggot Posted September 24, 2017 Share Posted September 24, 2017 @LionsDragon It is grass Quote 道生一,一生二,二生三,三生萬物。 non-existence made one, one made two, two made three, three made matters. 道可道,非常道;名可名,非常名。 well-defined principles are not eternal principles, names that can be named are not eternal names. Link to comment Share on other sites More sharing options...
LionsDragon Posted September 24, 2017 Share Posted September 24, 2017 Well then it is the softest, most luxurious grass I've seen in some time! I envy your characters for getting to walk on it. 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.