Editing Krita - Seamless Texture Creation

From Wiki.OSArch

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 113: Line 113:
 
== Removing Soft Shadow Effects ==  
 
== Removing Soft Shadow Effects ==  
  
We now have a fairly good geometric match but, in terms of colors and texture.
+
We can see the globally we now have a fairly good geometric match but in terms of colors and texture we still have noticeable seems as well as areas of the image that are much darker than others.  
  
There are also areas of the image that are much darker than others.
+
This is usually due to vignetting effect that is either introduced by the camera or post producion effects on the original image. It might also be related to some objects casting shadows on the geometry. If this shadows are soft we can try removing them, if they are hard shadows, removing them will be very difficult.
 
 
This is usually due to the vignetting effect that is either introduced by the camera that shot the photo or by post production effects on the original image. It might also be related to some objects casting shadows on the geometry that were impossible to remove on the original photo. If these shadows are soft we can try to remove them, but if they are hard shadows removing them will be very difficult.
 
  
 
We will try to get rid of these soft shadows or vignetting in a fast way, using pixel information on the original layer:
 
We will try to get rid of these soft shadows or vignetting in a fast way, using pixel information on the original layer:
  
# Make sure that '''Wrap Around Mode''' is Turned '''On'''
+
# Make sure that Wrap Around Mode is Turned On
# On the '''Layers Docker''', '''Duplicate the background layer''', by '''Right Click''' on it and choosing '''Duplicate Layer or Mask'''
+
# On the Layers Docker Duplicate the background layer by Right Click on it and choosing Duplicate Layer or Mask
# Desaturate the new Layer by clicking on it and going to '''Filter > Adjust > Desaturate'''.
+
# Desaturate the new Layer by clicking on it and going to Filter > Adjust > Desaturate.
 
# You can accept the standard desaturation mode but usually it’s better to use the one that gives you higher contrast.
 
# You can accept the standard desaturation mode but usually it’s better to use the one that gives you higher contrast.
  
 
[[File:Krita - Duplicating and Desaturating the Layer.gif]]
 
[[File:Krita - Duplicating and Desaturating the Layer.gif]]
 
        
 
        
The next step will be using the desaturated Layer to remove shadow information to the background image:
+
The next step will be used to remove shadow information to the background using this desaturated layer.
 +
# Make sure the Desaturated Layer is selected and change it’s blending mode to Grain Extract.
 +
# Do this by clicking to the Layer Blend modes dropdown menu on the top of the Layers Panel. It’s a button that reads Normal, above the opacity slider.
 +
# You’ll find Grain Extract in the Mix submenu in the bottom of the list.
 +
# While you’re at it click the box next to Grain Extract to make it a favorite, and readily accessible at the top of the list.
 +
# You’ll notice that the result will be an image with basic colors and the darkest pixels have been reduced to grey.
 +
# Now we’ll blur the image by Going to Filter > Blur > Gaussian Blur.
 +
# Slide the top slider to something about 100.
 +
# You’ll notice texture detail will start to pop up again. The image will increase texture definition while also getting rid of the shadow fills caused by the soft shadows or vignetting.
 +
# Fine tune the Opacity slider of this Layer, to have a less intense effect and fine tune it until you feel it’s right. Info.
  
# Make sure the '''Desaturated Layer''' is selected and change it’s blending mode to '''Grain Extract'''.
+
The idea here  is to get rid of darker areas and projected shadow artifacts to get the basic colors with no lighting info. The lighting info will be given by your render engine when it renders. Having shaodow on the texture will create noticeable errors on your final image, as the lighting effects on the texture will conflict with the light being produced by the render engine on the surface.
# Do this by clicking to the '''Layer Blend Modes Dropdown Menu''' on the top of the '''Layers Panel'''. It’s a button that reads '''Normal''', above the '''Opacity Slider'''.
 
# You’ll find '''Grain Extract''' in the '''Mix''' submenu in the bottom of the list.
 
# While you’re at it click the '''tick box''' next to '''Grain Extract''' to make it a '''Favourite'''. It will now be readily accessible at the top of the list.
 
# You’ll notice that the result of the Grain Extract blend mode will be an image with basic raw colors, where the darkest pixels have been reduced to grey.
 
# Now we’ll blur the image by going to '''Filter > Blur > Gaussian Blur'''.
 
# Slide any of the sliders to something about '''100'''. You can push for more if shadows are really soft and less if shadows are harder.
 
# You’ll notice texture detail starting to pop up again. The image will increase texture definition while also getting rid of the shadow fills caused by soft shadows or vignetting.
 
# Finally fine tune the '''Opacity slider''' of this Layer. You'll have a less intense effect and you can keep fine tuning opacity until you feel it’s right.
 
  
 
[[File:Krita - Using Grain Extract.gif]]
 
[[File:Krita - Using Grain Extract.gif]]
 
The idea here  is to get rid of darker areas and projected shadow artifacts to get the basic colors with no lighting info. The lighting info will be given by your render engine when it renders. Having shadows on the texture would create noticeable errors on your final image, as the lighting effects that would be present on the texture would conflict with the light being produced by the render engine on the surface.
 
 
This final output, is often called BaseColor or Albedo in render or game engines. Of course this isn't a scientific way of having accurate albedo textures but it's a way to remove shadow information, thus getting the final texture closer to it.
 
 
There are a lot of situations where the desired result is not a more accurate rendering texture, but rather an expressive tiling texture. If that is the case you can skip this process.
 
  
 
== Save a Duplicate of Your File and Merge Layers ==  
 
== Save a Duplicate of Your File and Merge Layers ==  
  
 
When you’re happy with the results you will have to consolidate the final image by merging Layers.
 
When you’re happy with the results you will have to consolidate the final image by merging Layers.
If you don’t do this the final step will not work right as it requires a single Layer. In order not to loose the possibility of fine tuning the current result later, and using less of an Albedo and more of the Original image expression, you should now save a duplicate and perform the layers merge on a new file:
+
If you don’t do this the final step will not work right as it requires a single Layer. In order not to loose the possibility of fine tuning the last step and produce a more expressive image to use for other purposes besides rendering, you should save a duplicate now and then merge layers.
 
+
# Save your file with a different name;
# Save your file with a '''different''' name using '''File > Save As''';
+
# Save it again with the final name;
# Save it again with the '''final''' name using '''File > Save As''' again;
+
# Right click on the Desaturated layer and select Merge Layers.
# Right click on the Desaturated layer and select '''Merge Layers'''.
+
# Save the file again.
# Save the file again but now you can use a regular '''File > Save'''.
 
  
 
[[File:Krita - Merge Layers.gif]]
 
[[File:Krita - Merge Layers.gif]]
Line 164: Line 156:
 
The final step of the process involves removing seams and, if you really want to be precise, removing exceptional features. Seams will be the obvious issue that breaks texture continuity, however, exceptional features on a texture, also contribute to see the pattern repetition and break realism.
 
The final step of the process involves removing seams and, if you really want to be precise, removing exceptional features. Seams will be the obvious issue that breaks texture continuity, however, exceptional features on a texture, also contribute to see the pattern repetition and break realism.
  
Though the concept is very easy to grasp, this is the most demanding part of the process, as it involves using a '''Clone tool'''.
+
Though the concept is very easy to grasp, this is the most demanding part of the process, as it involves using a Clone tool.
 
 
 
You’ll notice that Krita’s clone tool isn’t an individual tool as it is in most image editing software as Photoshop, Affinity or Gimp. What happens is that Krita has a very powerful brush system and any of it’s brushes can be converted into a clone tool.
 
You’ll notice that Krita’s clone tool isn’t an individual tool as it is in most image editing software as Photoshop, Affinity or Gimp. What happens is that Krita has a very powerful brush system and any of it’s brushes can be converted into a clone tool.
  
I’m not going to go deep into that regard though, as one of Krita’s brushes is the '''Clone tool''' and it works very well. You just have to search for it, among the hundreds of brushes there are available like this:
+
I’m not going to go deep into that regard though, as one of Krita’s brushes is the Clone tool and it works very well. You just have to search for it, among the hundreds of brushes there are available like this:
  
# On the '''Brush Presets Docker''' click on the '''Dropdown List''' on top of the Docker.
+
# On the Brush Presets Docker click on the dropdown list and find the Digital Submenu;
# You'll find the '''Digital''' Submenu on the List;
+
# You’ll find the Clone Tool in the bottom of that List.
# The '''Clone Tool''' in at the bottom of the '''Digital''' Submenu's List. It's a folding ruler icon and it's very easy to miss it, so pay attention to the gif below.
+
# To work with it you can leave default values and just change the size of the Brush in the Top bar or, if you want to be fast, by Holding Down SHIFT+Left Click and Drag the Mouse Left or Right to decrease or increase the Brush’s size.
# To work with it you can leave default values and just change the '''Brush Size''' in the top bar or, if you want to work faster, hold down '''SHIFT+Left Click and Drag the Mouse Left or Right''' to decrease or increase the Brush’s size.
+
# You’ll also notice that the brush pointer has two circles. One is the actual Brush and the other represents where’s the clone being referenced on the image. To use the brush you must first find which part of the image to reference. To do that, you hold CTRL key and click on your image.
# You’ll also notice that the brush pointer has two circles. One is the actual Brush and the other represents the part of the image being cloned when you click on the brush. To use the brush you must first find which part of the image to reference. To do that, you '''hold CTRL key and click''' on your image.
 
  
 
[[File:Krita - Clone Tool.gif]]
 
[[File:Krita - Clone Tool.gif]]
Line 180: Line 170:
 
=== Removing Seams ===
 
=== Removing Seams ===
  
In this case we’ll have a very difficult task ahead as we will have to break a huge color difference from the bottom to the top. At the same time we have to keep an eye on geometrical features in the image and try to follow them.
+
In this case we’ll have a very difficult task ahead as we will have to break a huge color difference from the bottom to the top. Using the clone tool we have to keep an eye on geometrical features in the image and try following them.  
+
Being careful where to pick the reference and how big should the Clone brush be, we can try figure out what should match what. This is a trial and error process where the only rule is: If it seems right it’s right.
Being careful where to pick the reference and where to click as well as on how big should the Clone brush be isn't easy and will require a trial and error approach. '''Use CTRL+Z for undo and CTRL+SHIFT+Z to redo'''.
 
 
 
At the end what matters in this process is that if it looks right it’s because it is right.
 
  
 
[[File:Krita - Working with the Clone Tool.gif]]
 
[[File:Krita - Working with the Clone Tool.gif]]
  
''NOTE: The tricky part on the image above was how to remove seams and make a nice transition between colors. I've used one of the existing lines to create that transition. Sometimes it's not that easy so choose your base images wisely or be prepared for extra work.''
+
''NOTE: The tricky part on the image above was how to remove seams and use one of the existing features to create the transition between colors. Sometimes it's not that easy, so choose your base images wisely or be prepared for extra work.''
  
  
 
=== Removing Prominent Features and Details ===
 
=== Removing Prominent Features and Details ===
  
We've removed seams and the color transitions are believable. However, zooming out, we can clearly see repetition patterns arising on the most prominent features:
+
However, zooming out, we can clearly see clear repetition arising on the most prominent features:
  
 
[[File:Krita - Repetition Features.jpg]]
 
[[File:Krita - Repetition Features.jpg]]
Line 203: Line 190:
 
We should consider what to do with these as:
 
We should consider what to do with these as:
 
* Imperfections matter for the quality of some materials. Without them the materials will be less interesting.
 
* Imperfections matter for the quality of some materials. Without them the materials will be less interesting.
* O bigger surfaces like bigger buildings, those features might cause a lot of harm to images as they make it easy to tell they are rendered. If you're not seeking to make realistic renders you might ignore the following steps, otherwise, as the tiling they produce is obvious those can also be addressed.
+
* However, on bigger buildings, those features might cause more harm than richness as the tiling they produce is obvious.
 
 
 
For the sake of this tutorial, using the clone tool again, we will remove them:
 
For the sake of this tutorial, using the clone tool again, we will remove them:
  
Line 211: Line 197:
 
== Final Output ==  
 
== Final Output ==  
  
You have to consider what will be the purpose of the final image. If it will be used in any offline renderer the size of the image is irrelevant as long as you have RAM or VRAM available in your system to hold up all the assets of your render. However, if you’re going to use the image in realtime render engines you should consider that a square image with a power of two pixel size might be mandatory.
+
You have to consider what will be the purpose of the final image. If it will be used in any offline renderer the size of the image is irrelevant as long as you have RAM or VRAM available in your system to hold up all the assets of your render. However, if you’re going to use the image in realtime render engines you should consider that a square image with a power of two pixel size be needed.
  
I always export as a power of two version for flexibility as I can reuse that image in all render engines I use. However, with images like this, which are very far from square, I first export it at real size and then create a second version as power of two, so I don't loose the original definition, if I need it for some reason.
+
I always export as a power of two version for flexibility. However, with images like this which are very far from square, I first export it at real size and then create a second version as power of two.
  
 
=== Export at Real Size ===
 
=== Export at Real Size ===
 +
To export the image you go to File > Export and replace the extension from .kra (Krita’s native file format) to the format of your liking. I use PNG as I can later add transparency to it if I like, without having to replace the image reference on my render engine.
  
To export the image you go to '''File > Export''' and replace the extension from '''.kra''' (Krita’s native file format) to the format of your liking. Usually people choose '''.jpg''' as it's lighter. I tend to prefer '''.png''' so I can later add transparency to it if I like, without having to change a '''.jpg''' to a '''.png''' and then having to replace the image on my render engine. This way I always use '''.png''' files and further edit them if needed. Also, '''.png''' files allow images to hold more color information, if the original image is more than '''8bit''' color depth ('''exr''', '''tif''' and '''hdr''' files can store up to '''32bit''' of color info and png can store up to '''16bit'''). This was not the case as the original image was a '''.jpg'''.
+
In the following example I do not use compression for saving the image, but that is usually overkill as the size of the image will be huge. Having no compression will only allow me to further edit it if I like, without loosing quality with each edit.
 
 
In the following example I do not use compression for saving the image but that is usually overkill as the size of the image will be very big. Having no compression will only allow me to further edit it if I like, without loosing quality with each edit.
 
  
 
[[File:Krita - Export.gif]]
 
[[File:Krita - Export.gif]]
  
 
=== Export as power of two version ===
 
=== Export as power of two version ===
 
+
To play it safe I don’t like to scale the .kra working file, I tend to save a lot so I will proably ruin it. So I open the exported version instead, scale it to the power of two and then export it. If I happen to accidently save it, I will only ruin the first export.
To play it safe I don’t like to scale the '''.kra''' working file, I tend to save a lot so I will proably ruin it. So I open the exported version instead, scale it to the power of two and then export it. If I happen to accidently save it, I will only ruin the first export.
 
  
 
Most used power of 2 image sizes are the following:
 
Most used power of 2 image sizes are the following:
 
 
* 512px*512px
 
* 512px*512px
 
* 1024px*1024px
 
* 1024px*1024px
Line 253: Line 236:
 
João Queiroz e Lima
 
João Queiroz e Lima
 
[https://casca.pt/ casca.pt]
 
[https://casca.pt/ casca.pt]
 
[[Category:Visualization and Documentation]]
 

Please note that all contributions to Wiki.OSArch are considered to be released under the Creative Commons Attribution-ShareAlike (see Wiki.OSArch:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)