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 73: Line 73:
  
 
Using the guide lines for reference we will now perform the Perspective Transformation:
 
Using the guide lines for reference we will now perform the Perspective Transformation:
# Click the '''Transformation''' tool,
+
# Click the Transformation tool,
# Select '''Perspective Transformation''' tool (second icon),
+
# Select Perspective Transformation tool (second icon),
# The first thing you’ll notice when trying to transform the Layer is that as soon as you start deforming it, guidelines will be hidden. (This seems like it should change and I just asked on the Krita forum to change it.)
+
# The first thing you’ll notice when trying to transform the Layer is that as soon as you start deforming it, guidelines will be hidden.
# Slide down the '''Background Layer’s Opacity Slider''' like in the animation below to around '''50%'''
+
# Slide down the Background Layer’s opacity slider like in the animation below to around 50%
# After that you can keep transforming the layer by using the '''Corner Grip Points''' on the perspective transformation tool.
+
# After that you can keep transforming the layer by using the corner handles on the perspective transformation tool.
# Keep '''zooming in and out and panning''' around so you have more control and also to avoid any Krita snapping that might be active. You might deactivate snapping on the Grid and Guides Docker.
+
# Keep zooming in and out and panning around so you have more control and also to avoid any Krita snapping that might be active. You might deactivate snapping on the Grid and Guides Docker.
 
# Shift the image until the joints align with the corresponding guide lines.
 
# Shift the image until the joints align with the corresponding guide lines.
# Hit '''Enter/Return''' key on your keyboard when you’re finished.
+
# Hit Enter/Return key on your keyboard when you’re finished.
  
''NOTE: On more severe transformations finishing one side after having done the first side will probably deform the first. You should check both sides before hitting ENTER to comit the transformation.''
+
Note: On more severe transformations finishing one side after having done the first side will probably deform the first. You should check both sides before hitting ENTER to comit the transformation.
  
 
[[File:Krita - Perspective Transformation.gif]]
 
[[File:Krita - Perspective Transformation.gif]]
Line 93: Line 93:
  
 
The overall process for cropping is to:
 
The overall process for cropping is to:
# Activate the '''Crop''' tool.
+
# Activate the cropping tool.
 
# Click on the first corner of a rectangle that represents the cropping.
 
# Click on the first corner of a rectangle that represents the cropping.
 
# Click on the second oposite corner of the rectangle
 
# Click on the second oposite corner of the rectangle
# Fine tune by zooming, panning and dragging the grips of the resulting rectangle
+
# Fine tune by zooming, panning and dragging the resulting rectangle
# Hit '''ENTER/RETURN''' to commit.
+
# Hit enter to commit.
  
''NOTE: Sometimes our transformation action leaves some transparent pixels on the margins of the image. Take care with those while cropping.''
+
''Note: Sometimes our transformation action leaves some transparent pixels on the margins of the image. Take care with those while cropping.''
  
 
=== Cropping 1 ===
 
=== Cropping 1 ===
Line 107: Line 107:
 
=== Cropping 2 ===
 
=== Cropping 2 ===
  
[[File:Krita - Cropping 2.gif]]
+
[IMAGE PLACEHOLDER]
 
 
After cropping we can turn on '''Wrap Around Mode''' and also '''Toggle Guide Visibility''' off. Hit '''W''' and go to '''View > Guides.'''
 
  
 
== Removing Soft Shadow Effects ==  
 
== Removing Soft Shadow Effects ==  
  
We now have a fairly good geometric match but, in terms of colors and texture.
+
After cropping we can turn on Wrap Around Mode and also Toggle Guid Visibility off. Hit W and go to View > Guides.
 +
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]]
+
[IMAGE PLACEHOLDER]
 
        
 
        
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.
# 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.
# 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.
# 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.
# 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 will be an image with basic colors and the darkest pixels have been reduced to grey.
# 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.
# Now we’ll blur the image by going to '''Filter > Blur > Gaussian Blur'''.
+
# Slide the top slider to something about 100.
# 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 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.
# 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.
+
# 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.
# 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]]
 
 
 
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.
+
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.
  
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.
+
[IMAGE PLACEHOLDER]
  
 
== 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]]
+
[IMAGE PLACEHOLDER]
  
 
== Removing Seams and Exceptional Features ==  
 
== Removing Seams and Exceptional Features ==  
Line 164: Line 155:
 
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]]
+
[IMAGE PLACEHOLDER]
  
 
=== 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:
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'''.  
+
If it seems right it’s right.
  
At the end what matters in this process is that if it looks right it’s because it is right.
+
I’ve managed to remove seams and use one of the existing features to create the transition between colors.
 
+
Removing Prominent Features and Details
[[File:Krita - Working with the Clone Tool.gif]]
+
However, zooming out, we can clearly see clear repetition arising on the most prominent features:
 
 
''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.''
 
 
 
 
 
=== 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:
 
 
 
[[File:Krita - Repetition Features.jpg]]
 
  
 
If we zoom in a bit we can also see even more evident repetition, in this case of some details:
 
If we zoom in a bit we can also see even more evident repetition, in this case of some details:
 
[[File:Krita - Repetition Details.jpg]]
 
  
 
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:
  
[[File:Krita - Removing Prominent Features.gif]]
+
[IMAGE PLACEHOLDER]
  
 
== 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.
+
[IMAGE PLACEHOLDER]
 
 
[[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 237: Line 211:
 
We can keep going up the scale, but 8k is already a very heavy image that consumes a lot of RAM and, these days, with GPU rendering, a lot of VRAM, which is limited in our Graphics Processing Units. Also consider that each material will use more than one texture so the BaseColor texture can go along very heavy textures like Normal Maps which are also colored.
 
We can keep going up the scale, but 8k is already a very heavy image that consumes a lot of RAM and, these days, with GPU rendering, a lot of VRAM, which is limited in our Graphics Processing Units. Also consider that each material will use more than one texture so the BaseColor texture can go along very heavy textures like Normal Maps which are also colored.
  
[[File:Krita - Scale.gif]]
+
[IMAGE PLACEHOLDER]
  
 
== Final thoughts ==  
 
== Final thoughts ==  
Line 253: Line 227:
 
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)