This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Equalize Textures with Average Blur & High Pass

Tags: None
(comma "," separated)
mkbreuer
Registered Member
Posts
3
Karma
0
Hy!
I am working a lot with krita to create seamless texture.
But there is one workflow i really miss.

Equalize Textures with Average Blur & High Pass
Here is a Photoshop Tutorial how to do this:
https://tolas.wordpress.com/2009/05/26/tutorial-how-to-equalize-textures-in-photoshop/

A Highpass filter is already there, but the Average Blur Filter is miss to finding the Average Color.

I would be great when in comes one day...

...Or is there a other way to do that?
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS
Well, to begin with, we cannot implement anything that we do not know the algorithm of, so that would first require figuring out the algortihm.

Though, I suspect you can just set gaussian blur to a real high level for what you need...
User avatar
gdquest
Registered Member
Posts
33
Karma
0
Gaussian blur doesn't work great for that, but instead of using a filter, you can just go ahead and fill the layer with a color of your choice. Prepare your setup, and tweak the base color with the Hue/Saturation filter. Not only does it work, but it allows you to improve the tone/feel of your texture. Or to neutralize it if the white balance is off.
mkbreuer
Registered Member
Posts
3
Karma
0
A manually choosen color has not necessarily the right color value.
But I will try this...
Thanks for the reply!
mkbreuer
Registered Member
Posts
3
Karma
0
I found a Trick to find the avarage color better:

1. duplicate the image layer
2. invert the image layer
3. Transfer the colour from the same image to the inverted
4. set opacity to 50%
5. Use Gaussian Blur for fine tune


Maybe someone can built a filter....?
rambo
Registered Member
Posts
1
Karma
0
Never mind.
saedjubarin
Registered Member
Posts
58
Karma
0
Actually I do mind.

Ran this piece of beauty in my Scripter and it did something that looks like the average color to my uneducated eyes.

Code: Select all
from PIL import Image
from krita import ManagedColor

doc = Krita.activeDocument()

w, h = doc.width(), doc.height()

#avg = doc.activeNode() # active (selected?) layer
avg = doc

pixeldata = avg.pixelData(0,0,w,h)

mode, size, data = "RGBA", (w, h), pixeldata

pylayer = Image.frombytes(mode, size, data) # PIL

#color_image = img.resize((1, 1)) # which is more correct?
color_image = pylayer.resize((1, 1), Image.ANTIALIAS) # lol

color = color_image.getpixel((0, 0))
mc = ManagedColor("RGBA", "U8", "")
mc.setComponents([c/255 for c in color])

view = Krita.activeWindow().activeView()

# I'd rather just Krita.activeWindow().activeView().setForeGroundColor(ManagedColor(tuple([c/255 for c in color_image.getpixel((0, 0))])))
view.setForeGroundColor(mc) # sure ForeGround is the proper casing?

new_node = doc.createNode("Average Color", "paintLayer")

doc.rootNode().addChildNode(new_node, None)

Krita.instance().action("select_all").trigger()
Krita.instance().action("fill_selection_foreground_color").trigger()
Krita.instance().action("deselect").trigger()

doc.refreshProjection()


Be my guest.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell