PDA

View Full Version : Photoshop - average blur within a selction area.


SHEPEIRO
08-12-2011, 04:29 AM
I often use a technique...

make ceramic tile texture... make normal map... (from high or just CB or heighmap)
then to give each tile slight normal offset i creat a cloud height map, convert to normal map then select each tile and average the cloud normal giving each tile a slight offset...works really nice with acute lighting...


ATM im making a rather large set of tiles... and i dont fancy selecting each tile and applying an average bluf filter to each...maybe 300+ tile...

so is there a way to blur keeping each of the selection areas seperate and NOT average across them...

ive done a few at the top here to show you what i mean.... and have a saved selection for all the tile surfaces.

cheers you great people you
http://dl.dropbox.com/u/1324504/norms.JPG

perna
08-12-2011, 05:21 AM
filters->Blur->Average

wait, I re-read and now I don't get what you're asking

perna
08-12-2011, 05:26 AM
If you've got all the selections defined, can't you just iterate through them and apply the blur?

SHEPEIRO
08-12-2011, 05:29 AM
no i have the tiles selected as a whole so i could go through them and select each one and average.. but i have 300+ in this texture (x 4 clicks of the mouse etc = a fuck load of time) and i do this fairly often so im trying to find if theres a more time efficient (and less ball busting) method

perna
08-12-2011, 05:35 AM
Ok, so it doesn't have anything to do with bricks and blurring.. what you want is

to separate selection islands and iterate through the results

correct?

SHEPEIRO
08-12-2011, 05:38 AM
absolutely...
got it down to one click and a hot key combo...but its stil RSI work

Autarkis
08-12-2011, 07:39 AM
I've been scratching my head trying to figure out how to do what you're asking for, and I really do not see a way for photoshop to average your values within each individual tiles across all your tiles in one sweeping move. However, just thinking out loud here, but since you're saying that you have a high poly done, you could always have in any 3d package select a random color ID to each tile ( if you're just using chamfered boxes in your 3d package to bake that HP from( and then just use those as selection masks inside photoshop to assign new normal colors? I think what i'm trying to say is getting pretty confusing, but it makes sense to me ;)
You're not gonna get that ultra randomness you're getting now ( well it all depends on how many ID colors you have) but still, better than to select a hundred tiles or more and do an average blur?

SHEPEIRO
08-12-2011, 09:09 AM
in this instance i was working from photo...but i do do it for HP too...although then i do usually djust do a slight random rotation on all the tiles...sorry friday explanations......pub is calling

i did this one by hand...took about ten minutes constant clicking...and while thats not long...its alot of repetition for something that SHOULD be easy.

Wrath
08-12-2011, 09:22 AM
Did something identical about a year ago for a pattern of shattered glass. Selected every shard individually by hand and ran an action to make randomly perturbed normals using average blur.

I think automating that kind of process would require a script. Cant' see how to get around not needing some sort of conditional logic. Have you looked into this?
http://www.adobe.com/devnet/photoshop/scripting.html

haiddasalami
08-12-2011, 10:10 AM
Thinking of how to go through the selections faster. One way would be to make cutouts of each tile distributed among layers and just iterating through those layers but at this rate might as well click each one :( Unless someone knows how to store selections into an array (dont think photoshop has anything but looking through the docs)

Mark Dygert
08-12-2011, 10:12 AM
I've been scratching my head trying to figure out how to do what you're asking for, and I really do not see a way for photoshop to average your values within each individual tiles across all your tiles in one sweeping move. However, just thinking out loud here, but since you're saying that you have a high poly done, you could always have in any 3d package select a random color ID to each tile ( if you're just using chamfered boxes in your 3d package to bake that HP from( and then just use those as selection masks inside photoshop to assign new normal colors? I think what i'm trying to say is getting pretty confusing, but it makes sense to me ;)
You're not gonna get that ultra randomness you're getting now ( well it all depends on how many ID colors you have) but still, better than to select a hundred tiles or more and do an average blur?I'm not sure I fully understand what you want to do but I'll try to clarify because my idea seems pretty similar.

If this was baked from geometry can you apply a specific set of colors to the brick and render out flat color masks with 100% self illumination. Then set up some kind of photoshop action that operates on those colors? "Select by color red, blur average, select by color green, blur average".
OR
"select by color, create layer from copy" so they all get separated out to different layers/masks?

That would require some leg work and syncing of colors in the 3d app to photoshop, but if you have to do it to a lot of tiles it could help automate the process and if the specific colors can be applied randomly in the 3d app, then you could run it a few times to get more mixed results and mix and match from what seems to work the best.

Even if its not caputured from high poly geomerty you could still select and create specific color groups, I guess...

Autarkis
08-12-2011, 04:11 PM
That's exactly what i was trying to come across as saying Mark. Sorry it was early in the morning from me, typing it from the airport.. and yeah, i knew it was going to get confusing ;)

Internet Friend
08-12-2011, 08:05 PM
I haven't tried this, but the first solution that comes to my mind is to render out a color mask with the tiles all one color, then use an AutoHotkey script with the PixelSearch (http://www.autohotkey.com/docs/commands/PixelSearch.htm) function to search for that color and Click (http://www.autohotkey.com/docs/commands/Click.htm) with the magic wand tool to select it, then run a photoshop Action to switch to the normal map and average blur. Loop until PixelSearch returns ErrorLevel 1 and it should do the entire screen.

MasteroftheFork
08-12-2011, 10:40 PM
Can't you just use the fill tool and just vary the colour a tad each poor then normalize it at the end?

perna
08-13-2011, 06:16 AM
Can't you just use the fill tool and just vary the colour a tad each poor then normalize it at the end?

That would be more clicks than he's already using.

I was going to suggest AHK, Internet Friend beat me to it. Should be more straight-forward than scripting in PS, which is a major pain.

Also, for stuff that is grid-like you can scale the cloud map down then scale it back up without filtering.

AzzaMat
08-13-2011, 07:44 AM
assuming all the bricks are the same size and forgive me if this is wrong because I only skimmed it, but couldnt you just create an action in photoshop thats does that action to one row and then drops the selection box down one and then just play that action over and over until the job is done? that way you would only have to click once to do each row, if you dont know how to do an action I can put up a quick tutorial on how to do it

haiddasalami
08-13-2011, 08:28 AM
assuming all the bricks are the same size and forgive me if this is wrong because I only skimmed it, but couldnt you just create an action in photoshop thats does that action to one row and then drops the selection box down one and then just play that action over and over until the job is done? that way you would only have to click once to do each row, if you dont know how to do an action I can put up a quick tutorial on how to do it

The problem with that is that you need to individually click each selection and average blur. If you select more than one tile, they all get the same average blur.

AzzaMat
08-13-2011, 08:55 AM
sorry I might not have been clear enough but re-reading my original message I can see why you though that, I worded it very poorly.The way the action command would work is it would select one brick, average blur then move onto the next brick along, This means it would only average that brick and none of the others would be taken into account. if you were to record yourself doing one row and then moving the selection field to the tiling brick bellow it you could do the entire image by just clicking the play button a few times

AzzaMat
08-13-2011, 09:11 AM
http://img8.imageshack.us/img8/7898/brickblurtechnique.th.jpg (http://imageshack.us/photo/my-images/8/brickblurtechnique.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)here is the image at the top but all nice and averaged per brick, apart from a few i left the top ones and I missed the corner bricks by accident. It actually took me longer to figure out how to upload it than it did to do the entire process including recording the action. for some reason my normal means of uploading weren't working

Internet Friend
08-13-2011, 10:37 AM
The trouble is you'd need a new action any time you make a new size of tile, and it won't work for irregular shapes. An AHK script would work on any size tiles, regular or irregular.

Adam L. Gray
08-13-2011, 11:02 AM
I'm sorry to say, but wouldn't it just be more simple to start over. And then create a new normal map, rendering the grit depth from a high poly mesh and adding any noise you would like afterwards?

Sorry I couldn't be of more help here, but don't think you'll get a very proper normal map out of it, without doing a shitload of work.

Alternatively, if you have a diffuse for it. You could try spiking the levels and see if you get a reasonably good enough 'select colour' mask out of it.

Cheers

Valandar
08-13-2011, 08:58 PM
And... wouldn't that just affect the apparant angle of each brick, not the apparant height?

Scruples
08-14-2011, 02:49 AM
That's what he is trying to do, just change the angle slightly.

perna
08-14-2011, 04:28 AM
I'm sorry to say, but wouldn't it just be more simple to start over. And then create a new normal map, rendering the grit depth from a high poly mesh and adding any noise you would like afterwards?


Hehe.. yeah, this. Why not just make the hipoly correct in the first place? At 3Point we never modify normal maps as that usually ends up being the slower and more workflow-breaking solution.

Millenia
08-14-2011, 04:40 AM
Hehe.. yeah, this. Why not just make the hipoly correct in the first place? At 3Point we never modify normal maps as that usually ends up being the slower and more workflow-breaking solution.

But you 3p types are machines and the rest of us are but mere mortals ;________;