Monday, August 25, 2014

Tutorial: How to make seamless patterns using Corel Paint Shop Pro X2

By Sydney Grey

This may also apply to other versions of Corel Paint Shop as well, but Paint Shop Pro X2 is the version I use to make seamlessly tiling patterns.  To see if your version of Paint Shop has the seamless patterns feature, look for it in the menu under "Effects/Image Effects/Seamless Tiling."  If you don't have Paint Shop yet but want to get it, make sure the version you're looking at has the seamless tiling feature before you buy. 

First off, not every image is going to work as a seamless pattern.  Some will leave very noticeable lines along the borders if you attempt to make them seamless.  You're going to have to find one that will work nicely, and sometimes this takes trial and error. 

Just a note:  I'm using a perfectly square pattern in this tutorial because it's a little easier for me.  A seamless pattern used in creating custom content for computer games like The Sims doesn't have to be perfectly square.  A rectangle would work, too. 

Click on the pictures to make them bigger.


Making a Pattern Seamless

The pattern I chose is actually a small, cropped section of a photograph of sequined fabric.  The best photos to use are ones that don't have shadows in them.  If the lighting in a photo is noticeably brighter on one side of the photo than the other, don't use it, because it won't tile correctly.  The best images to use have even lighting, and a general sameness and symmetry on every edge. 

Bring up your pattern in Paint Shop.  Click on "Effects/Image Effects/Seamless Tiling."  It will bring up a window with a "Before" and "After" picture.  Keep the setting on their defaults, which will be Edge Tiling and Bidirectional.  You can play with the Direction settings, but you definitely want the Tiling Method to be set on "Edge."



Click OK.  You'll see your pattern suddenly shift in front of you.  You may notice a little blurring at the edges, but this is expected.  It's now seamless!  It's that easy.  Except that you'll have to check it first before you can use it for a modding project, because some patterns will look terrible when they're turned seamless this way, and you don't want to discover it's terrible only after you try to apply it to custom Sims clothing. 

Testing and Reducing the Size

To test it, go to "File/New" and create a new image that is exactly twice the dimensions of your seamless pattern.  I generally make it easy on myself and start with a 200x200 pixel pattern, then make the new image 400x400 to test my new seamless pattern. 


Right-click on your seamless pattern and click on "Copy."  Then click on the new, blank image and click on "Paste as New Layer." Do this four times to put four versions of the pattern on the blank image.  Each layer will appear on top of the other one, so you'll have to move them in order to see all four.



Find the "Move" tool in the toolbox.  It looks like four arrows going in four different directions.  Use this to move one square of your pattern to one upper corner, getting it lined up with the edges of the blank image exactly.  The "Pan" tool (the hand, right above the "Move" tool) is used to grab the image, or to click on various open images in Paint Shop, but the "Move" tool is used to move layers within one of those images.  Often when I'm making seamless patterns, I'll switch back and forth between the "Pan" and "Move" tools frequently.

Move all four copies of your pattern to the four corners of the blank image.  The edges should match up perfectly.  If you see some noticeable lines where the edges meet, then you shouldn't use that pattern.  If the resulting image looks seamless to you, then it will be seamless on your Sims custom content.




If you want to save the new image you just made (the one with the four layers on top of the blank image), go to "Layers/Merge/Merge All (Flatten)."  If you make this new image the same size as your old image, you'll see that the pattern appears smaller on the new image.  In this next picture, I resized the new image to 200x200 pixels like the original image, so you can see the difference.  The smaller print will probably work better for Sims clothing.


That's it!  This seamlessly tiling pattern can now be taken into GIMP or Photoshop and used to create custom Sims clothing and items.  For directions on how to do this in GIMP, please read my other tutorial, here

Tutorial: Using GIMP with Color Magic to make Custom-Textured Sims 4 Clothing

By Sydney Grey

PLEASE NOTE:  This is an old tutorial, using an outdated version of Color Magic.  I'll leave it up here in case it's useful for somebody, though.

Some parts of this tutorial are based on this tutorial by BlackGarden on Platinum Simmers.  It shows how to create custom-textured Sims 4 clothing in Photoshop.  I thought I'd do a tutorial that shows how to do the same thing in GIMP, as the controls are different.   I've also included a lot of GIMP-specific information, such as where to find the DDS plugin and how to install it, the nuances of GIMP's "Overlay" feature and how their pattern tool works.  Without BlackGarden's tutorial, I never would have been able to do the same in GIMP, so I want to give credit where credit is due.

Click on the pictures to make them bigger.

This tutorial uses:

GIMP 2.8.10 
DDS plugin for GIMP 
Color Magic tool 
S4PE 


Exporting the Original Texture

To create a custom texture for a Sims 4 item, you need to change the original texture into a DDS file, edit it in GIMP, replace the original texture with your edited version, then turn it back into a package file for use in the game again.  That's it in a nutshell, and I'll tell you step-by-step how to do that.

First, from your Color Magic folder, open colormagic.exe.  Click next.

Select "Sims 4," then put in your creator name.  Decide whether you want to do a default replacement or not and check the box if you do.  I wanted mine to be non-default.

You can use the filters to find the clothing you're looking for.  It helps to use a light-colored and solid-colored version of the clothing item.  I chose the light blue version of the satin wrap top, since I planned to desaturate the color later.  Click next.


Give your creation a unique item name if you're not doing a default replacement.  The "Edit Flags" button is what you use to scroll through to choose new categories for the clothing you're making.  For example, if you want something enabled for formal wear that wasn't already enabled for that category, you can do it via the Edit Flags button.  You can select a new color for the swatch, or click on Remove/Add to set it up so you can do a custom swatch later.  Click on "Save As" and save it to your desktop as a package file.



Turning the Texture into a DDS File

Open your new package file in s4pe.  It'll give you a short list of codes.  Click on each one until you see the color texture of the clothing item show up in the viewing box. 

Right-click on that one.  Click on "Export to DDS" and save it to your desktop.  Don't close s4pe, because you'll be using it again later.  Leaving it open will save you time when your edited texture is finished and you need s4pe again. 


Installing the DDS Plugin in GIMP
Now you can open your new DDS file in GIMP.  By default, GIMP cannot read DDS files, but you can enable the program to read DDS files by installing a plugin.  If you have a 64-bit computer, then you need the 64-bit version of the DDS plugin.  The link to the DDS plugin download page is at the beginning of this article.

To install the plugin in GIMP, extract the contents of the zip file with 7-zip (or a similar program) and place the extracted files in the following location:  Computer/Local Disk (C:)/Program Files/Gimp 2/lib/gimp/2.0/plug-ins.  Your computer and version of GIMP might be different, but this is where the plugin goes on my computer (a Windows 7 PC).  To check it, open any random picture in GIMP and click on "Save As."  If it gives you the option to save as a DDS, then it's working.

Editing the Texture

Open the file in GIMP.  Do NOT generate mipmaps.   Once you have opened the DDS file of the clothing texture in GIMP, make sure you have the "Layers" window open.  You can find this in Windows/Dockable Dialogs/Layers.  If the "Toolbox" menu isn't showing, bring it up by going to Tools/New Toolbox. 


Before you do anything else, you'll want to do two things to the original layer before you make a new one (both optional).  First, you'll want to bring the contrast up slightly so the folds, shadows and other detail will show through better to the upper layer that you'll be creating.  If this creates some very bright "glare" spots, you can take the brightness down a bit to compensate.  Also, if you're using an original texture that has any color to it, this color will show through to the top layer, so use "Colors/Desaturate" to take the color out.  Don't edit the original layer any further than doing these few things.


Now it's time to make your top layer.  Go to "Layer" and click on "New From Visible."  You should see an extra layer pop up in your Layers window.  It'll say "Visible" on it.  Click on the new layer in the window to make sure it is selected, and not the layer underneath it.


You now can start applying colors and patterns on the texture.  Only edit the "New from Visible" layer.   The original, bottom layer will be left alone from this point onward.


You'll be using the Bucket Fill tool from your toolbox to apply the new color or pattern.  Simply double-click on the foreground/background (black and white) color squares to select any color you like.  Double-clicking on the Bucket Tool will bring up the Tool Options menu.  Here you want to change "Mode: Normal" to "Mode: Overlay."  Opacity should be at 100, and the Fill Type for solid colors should be on "FG Color Fill."  Bring the Threshold up to 100.  You can lower or raise the Threshold setting if you have to, to determine what works best for your project, but a Threshold of 100 is a good place to start.

Once you select a color, click on your top layer (the "Visible" layer).  It should very lightly fill with the color you've selected.  You can click many times with the Bucket Fill Tool, and every time you click, it will darken the color a bit.  Click until you get the color you want, while still retaining some of the shadows, creases and detail from the bottom layer. 

Using a custom pattern is even more fun, and I'll tell you how to do it in the next section.

Using a Custom Pattern

You can use your own custom patterns in GIMP.  Do this by opening a seamlessly-tiling pattern in GIMP.  (For directions on how to make seamless patterns in Corel Paint Shop, please see my tutorial here.)  The pattern doesn't have to be perfectly square, but it should be not more than 200 pixels wide/high.  Then right-click on that pattern, and click on "copy." This will bring the pattern into the Patterns menu as the very first selection. 


Double-click the Bucket Fill icon.  This will bring up the Tool Options menu.  Here, change "Mode: Normal" to "Mode: Overlay."  Change the Fill Type to "Pattern Fill" and select your custom pattern.  Opacity should be 100, and you'll have to bring up the Threshold.  I generally start the Threshold out at 100, and then adjust from there depending on how nicely the pattern fills the Visible layer.

Fill the clothing texture with the new pattern.  If the pattern appears too large on your clothing texture, make the original square even smaller, do right-click and "copy" again, and then use the Pattern Fill tool again.  The pattern should come out smaller on the clothing.

Gimp does a very light overlay.  To make it darker, do not create another layer.  Simply click several times on your clothing texture with the Bucket Fill tool on the Overlay setting.  Each time you click, the image will get darker and darker while still retaining the detail from the bottom layer. 

Finishing and Exporting

When you have it the way you want, click on "Image/Merge Visible Layers."  Don't change the default settings here.  It should say "Final, merged layer should be: Expanded as necessary."  Click "Merge."


Click File/Export As.  Save as a DDS file again.  Compression should be BC3/DXT5 and checkmark on "Generate Mipmaps."

Go back to s4pe.  Bring up the clothing texture you are working on.  (If you left s4pe open, it should already be on the screen. ... If not, you'll have to open the original package file again first before you can import your edited DDS file.)  Right-click on the line that shows the original texture again and click on "Import from DDS."  Click "yes" when it asks you if you want to commit changes.  


You're done!  Go to File/Save As and save it to your desktop.   If you get an error message, ignore it and save the file anyway.

It's saved once again as a package file, and now ready to try in your game.

Testing

It works!  If I wanted to make the color darker or more saturated, I could bring the DDS texture file back into GIMP to edit it again.  To do this, I'd open the DDS file in GIMP, then use the Bucket Fill tool again once more to darken it.  You don't need to make a new layer to do this: simply apply it to the original edited layer.  Then re-package it once again with s4pe to make your new version.


***

Thanks to the modders who made the Color Magic and s4pe programs!  You're awesome.  And thanks to BlackGarden, who wrote the Photoshop tutorial on Platinum Simmers, without which I wouldn't have been able to do this.