Forums > Digital Art and Retouching > HighPass Sucks (+ solution)

Photographer

PANZERWOLF

Posts: 68

Vienna, Wien, Austria

Robert Randall wrote:
Is it Moire', or is it edge detail of a posterized image?

i'm not aware of posterization in that image
and it's not visible when working in 16bit, which i would expect if it was edge detail
but see for yourself, i used the background layer of the image sean provided for download here

Oct 13 09 12:28 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

PANZERWOLF wrote:
your soccer guy image, radius 25
in 8bit it's actually worse with the contrast/brightness method
although it's not a real problem, since it's pretty low, with a maximum difference of about (1/2/1), but when amplified you can see moiré patterns that i haven't seen with the apply image methods

here's a comparison
left side is normal difference, right side is amplified with the steepest possible curve

Damn.

That's what I get for testing primarily on a B&W image and only doing a cursory color run.  Much less that I didn't do the math.

What am I talking about (the math)?  We'll talk 8-bit here, but it applies in 16 as well.  A 0-255 image, halved in contrast = a 64-191 image (ish).  Each stepping therein becomes doubled in its effective value.  Rounding 'errors' in the Apply Image (Subtract) / Scale 2 technique have been giving us only maximal 1-step offsets in each channel, evening out to appear as if a simple noise function.  But when we halved the number of steps available in the base image, we increase the amount of error we live with (literally doubling it).  In a way, this is a posterization issue as the limitation on values for each channel has imparted the error, and as our technique works within the HF data, it is localized therein giving the moire-like pattern we're seeing (interference of the stepping with the HF).

It was a complete oversight on my part that I even posted about it being valid in 8-bit as a good alternative - still far better than a straight HP filter mind you, but one with some obvious disadvantages.  For 8-bit, still stick with the OP technique to get the best accuracy.

As to the RT skin editing post, though, I'll suggest that this is still valuable for 16-bit work as a 2/32k error is irrelevant, particularly in light of the value of being able to tweak smoothing as you go.  If complete accuracy is imperative, use the OP technique.  That it has greater error than advertised, though, is a mistake and I'll revise my statements.  Apologies again for the misleading and props to PW for calling me on it.

Freaking math.  I should never have given away my calc books sad.

Oct 14 09 06:41 am Link

Photographer

rey sison photography

Posts: 1805

Los Angeles, California, US

After glancing at this threads for several months, I finally gave this technique a go. Although I haven't completely figured out what to do with it and I haven't read everything in this thread, I am excited about the potential. Anyway, I thought I would share what I ended up with combining this with my novice retouching skills.

https://modelmayhm-6.vo.llnwd.net/d1/photos/091014/18/4ad677dec6f29_m.jpg

Oct 14 09 06:23 pm Link

Photographer

rey sison photography

Posts: 1805

Los Angeles, California, US

Sorry I haven't figured out this resizing thing but it's in my port if you want a better look.

Oct 14 09 06:24 pm Link

Photographer

Les Mizzell

Posts: 13

Columbia, South Carolina, US

> I keep updating the action set. The latest is here:
> https://www.modelmayhem.com/po.php?threa … st10668592

I'm slowly starting to understand the basics of what this is doing. Pretty amazing work.

Now, is there a "dummies guide" showing basic steps to how some of the folks here are getting the results they're getting after running the action?

Yea, darned newbs - I know, I know...

Oct 15 09 01:39 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Les Mizzell wrote:
> I keep updating the action set. The latest is here:
> https://www.modelmayhem.com/po.php?threa … st10668592

I'm slowly starting to understand the basics of what this is doing. Pretty amazing work.

Now, is there a "dummies guide" showing basic steps to how some of the folks here are getting the results they're getting after running the action?

Yea, darned newbs - I know, I know...

You'll probably do better to point to a specific example and ask how it was done vs. asking so vaguely.  The technique here and its many, assorted derivatives leave a lot of options as to what you may be looking to emulate.

Oct 15 09 02:52 pm Link

Photographer

Damien Menard

Posts: 3

Portland, Oregon, US

Sean Baker wrote:
I'm not sure if I'm on the same sheet as you guys are discussing here, but it's possible to create near infinite levels of separation without meaningful loss (albeit loss does become additive per iteration).  Here is a multi-layer TIFF (~2.8MB) containing 6 orders of frequency separation with a cumulative loss of roughly (6,5,4) [R,G,B] (16bit) in the worst areas.  This done by duplicating and re-blurring the 'LF' layer repeatedly.  Though the provided file is in 8bit for size purposes, all separation was done in 16bit for accuracy.  Hope that helps.

Yes! This is exactly what I've been trying to do. Thanks for posting the .tif, I think I've figured out the process from it.  Here's what I've been doing:

(after splitting image at 1 pixel frequency, leaving background layer untouched)
blur low frequency layer by 5 pixels
apply image on fresh copy of background
     blur that layer by 1 pixel, rename "1-5"
blur low frequency layer by 10 pixels
apply image on fresh copy of background
     blur that layer by 5 pixels, rename "5-10"

so your layer stack would be:

"10"
where "1-5" and "5-10" are bandpass layers. Still having some contrast/darkening issues. How did you lighten and denoise your "merged (difference)" layer, if I might ask?

Oct 16 09 11:50 am Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Damien Menard wrote:
Yes! This is exactly what I've been trying to do. Thanks for posting the .tif, I think I've figured out the process from it.  Here's what I've been doing:

(after splitting image at 1 pixel frequency, leaving background layer untouched)
blur low frequency layer by 5 pixels
apply image on fresh copy of background
     blur that layer by 1 pixel, rename "1-5"
blur low frequency layer by 10 pixels
apply image on fresh copy of background
     blur that layer by 5 pixels, rename "5-10"

so your layer stack would be:

"10"
where "1-5" and "5-10" are bandpass layers. Still having some contrast/darkening issues. How did you lighten and denoise your "merged (difference)" layer, if I might ask?

Similar, but I think we're talking about getting there slightly differently and with a bit varying results.  I've drafted a quick script here which should decompose a 16bit image into as many slices as you'd like using the method I've failed to explain simply enough.  Hopefully watching it run through things will make it a bit more clear for you, as well as simplifying all our workflows (?).

For the geeks in the crowd, I'll update this sometime tomorrow with some sanity checking, interface improvements, and hopefully including an option to pair some curves layers onto each layer as it goes.  For now, I'm going to bed.

P.S. For those updates, could someone tell me what the maximum gaussian blur radius is in CS4?  Thanks.

EDIT: It's got issues; I'll fix them tomorrow.  Bah.

Oct 17 09 08:58 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Script from above now at ver. 0.3 - works in 8 or 16bit (16bit is far more accurate - I'm going to look into trying to make 8bit play nicely with high #s of separations, but give me time - I'm happy to take suggestions), works on any size, works on whatever is currently visible (single layer or multiple) and should be fine for any resolution.  It has no warranty, may erase your entire HD, etc. etc. etc.

As to Damien's question about the difference between the Merged copy and the versions below it, I apologize for not noticing that earlier, but it's a result of the 16bit->8bit conversion and nothing really else.  The loss of accuracy between them results in rounding errors which compound to create the noise which you see in the actual merged copy vs. that which is present in the above layer.  Take it as evidence for the value of using 16bit for this process, even if some will argue 16bit has no other value tongue wink.

Oct 18 09 05:15 pm Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Sean Baker wrote:
Script from above now at ver. 0.3 - works in 8 or 16bit (16bit is far more accurate - I'm going to look into trying to make 8bit play nicely with high #s of separations, but give me time - I'm happy to take suggestions), works on any size, works on whatever is currently visible (single layer or multiple) and should be fine for any resolution.  It has no warranty, may erase your entire HD, etc. etc. etc.

As to Damien's question about the difference between the Merged copy and the versions below it, I apologize for not noticing that earlier, but it's a result of the 16bit->8bit conversion and nothing really else.  The loss of accuracy between them results in rounding errors which compound to create the noise which you see in the actual merged copy vs. that which is present in the above layer.  Take it as evidence for the value of using 16bit for this process, even if some will argue 16bit has no other value tongue wink.

MMMMMM.......scripts.......https://fc04.deviantart.com/fs25/f/2008/036/0/3/_drool__by_crula.gif

Thanks once again, Sean. This is awesome!

Oct 18 09 05:32 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Photons 2 Pixels Images wrote:
MMMMMM.......scripts.......https://fc04.deviantart.com/fs25/f/2008/036/0/3/_drool__by_crula.gif

Thanks once again, Sean. This is awesome!

Don't be so humble - I wouldn't have even known scripts were possible if you hadn't started writing them around here.  Feel free to make suggestions for improvement - I know it could use some.

Edit: Now 0.4 - includes option for clipped curves layers applied to each layer other than the background.

Now 0.5 - includes fix for curves problem as well as rounds to 1 decimal point all values displayed in the Layers menu.

Oct 18 09 05:34 pm Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Sean Baker wrote:
Don't be so humble - I wouldn't have even known scripts were possible if you hadn't started writing them around here.  Feel free to make suggestions for improvement - I know it could use some.

Edit: Now 0.4 - includes option for clipped curves layers applied to each layer other than the background.

Now 0.5 - includes fix for curves problem as well as rounds to 1 decimal point all values displayed in the Layers menu.

smile

I wrote this script for the output sharpening method you talked about in another thread. It uses the Apply Image for the appropriate bit depth but set up a bit differently than you do here.

I dropped it in the Photoshop Actions and Scripts Depository thread. Not sure if anyone else found it useful, but I use it all the time. There might be some code snippets you'd want to use elsewhere. Feel free. Or parts and pieces of the other scripts I've dropped in there.

I'm working on one now that can analyze 2 different spots (or potentially more) and set up appropriate adjustment layers, masked, to equalize the colors at those spots. (There's a prototype in that thread.) It's just another piece that will go along with this method to bring back any color shifts caused by multiple iterations. At least that's my hope. I'm thinking if the shift can be calculated between the background layer and the stack, it can be compensated for. This gets us one step closer.

And so does the script you just wrote here. This truly is a wonderful addition to "The Highpass Cause". See, we have a Cause now. Feel special?

Oct 18 09 06:55 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Photons 2 Pixels Images wrote:
And so does the script you just wrote here. This truly is a wonderful addition to "The Highpass Cause". See, we have a Cause now. Feel special?

I've always been special - just not always in the good way!

Now at 0.5 mk2 (the Canon 5D edition) thanks to a typo in variable names which had to be fixed lest someone use an invalid radius.

Oct 18 09 09:00 pm Link

Retoucher

RETOUCHLAB

Posts: 53

Los Angeles, California, US

Oct 19 09 08:26 am Link

Retoucher

Q3S

Posts: 98

Córdoba, Córdoba, Argentina

I really don't get this technique. After all, the image keep looking the same than at the beginning. What should I do next?

Oct 21 09 05:08 am Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Quantum3studio wrote:
I really don't get this technique. After all, the image keep looking the same than at the beginning. What should I do next?

The point was to make it the same, albeit in two layers - so if you've gotten there, you've done it all right.  What you do next is up to you - as has been laid out, you can heal / clone in the separate layers, apply curves to emphasize or de-emphasize different spatial ranges, add / remove color shifts in the same, etc.  Sharpening (curves applied to the HF data) is only the beginning.

Oct 21 09 05:15 am Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Quantum3studio wrote:
I really don't get this technique. After all, the image keep looking the same than at the beginning. What should I do next?

I do some healing/cloning on the HF layer to clean up the skin a bit and on the LF layer to even out the skin tones.

I also make iterations of the HF layer, inverted mask, and open up the mask in areas I want a bit sharper.

I also do a selection (on the LF layer) as grahamsz talked about earlier in the thread, copy the selection up to another layer and run another GB on that, then invert a mask on it and open it back up for a bit smoother skin.

Multiple iterations of the HF layer using different GB radii with a ckipped curves adjustment layer on each gives you nice control over your spatial frequencies, similar to an equalizer.

And if you come up with anything interesting, please share. smile

Oct 21 09 05:51 am Link

Retoucher

Q3S

Posts: 98

Córdoba, Córdoba, Argentina

Photons 2 Pixels Images wrote:

I do some healing/cloning on the HF layer to clean up the skin a bit and on the LF layer to even out the skin tones.

I also make iterations of the HF layer, inverted mask, and open up the mask in areas I want a bit sharper.

I also do a selection (on the LF layer) as grahamsz talked about earlier in the thread, copy the selection up to another layer and run another GB on that, then invert a mask on it and open it back up for a bit smoother skin.

Multiple iterations of the HF layer using different GB radii with a ckipped curves adjustment layer on each gives you nice control over your spatial frequencies, similar to an equalizer.

And if you come up with anything interesting, please share. smile

I would like to come up with at least something! This technique seems to be quite hard to use. I'm still without a clue about this. If I use the healing brush on the HF layer I get something like using the burn tool, if I use the healling in the LF layer appears like more texture, but the blemish still there.

I use anothe rsimilar techique which is dup, set to linear light, opacity 50% invert, apply HP then blur then black mask and paint. That's the one I know.

I would appreciate a bit of your knowledge.

Oct 21 09 06:43 am Link

Retoucher

ShadowLight

Posts: 203

Quantum3studio wrote:
I would like to come up with at least something! This technique seems to be quite hard to use. I'm still without a clue about this. If I use the healing brush on the HF layer I get something like using the burn tool, if I use the healling in the LF layer appears like more texture, but the blemish still there.

I use anothe rsimilar techique which is dup, set to linear light, opacity 50% invert, apply HP then blur then black mask and paint. That's the one I know.

I would appreciate a bit of your knowledge.

when "healing" do it on "current layer" only wink

Oct 21 09 06:47 am Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Quantum3studio wrote:

I would like to come up with at least something! This technique seems to be quite hard to use. I'm still without a clue about this. If I use the healing brush on the HF layer I get something like using the burn tool, if I use the healling in the LF layer appears like more texture, but the blemish still there.

I use anothe rsimilar techique which is dup, set to linear light, opacity 50% invert, apply HP then blur then black mask and paint. That's the one I know.

I would appreciate a bit of your knowledge.

When doing this there are a few things to keep in mind.

1. The separation radius is critical to how the layers will react individually. You may do something on the LF layer and still see traces left that are on the HF layer and vice versa.

2. When taking your sample point, make sure you are sampling from the current layer only.

3. A practice I use is to turn visibility off for the HF layer and work on the LF layer tones first. Then turn HF back on and work on details.

4. It does take practice and trial/error to get it down. I will say that in my opinion, the time it takes to learn a workflow using this is well worth it.

Oct 21 09 06:50 am Link

Photographer

Mask Photo

Posts: 1453

Fremont, California, US

Photons 2 Pixels Images wrote:
I will say that in my opinion, the time it takes to learn a workflow using this is well worth it.

QFT

I've only spent a couple hours learning this procedure and was able to shave nearly an hour off the editing of a photo last night. I was even able to fix wrinkles in fabric just by healing them away, no shenanigans required.
Here's my initial layer stack, as I've got it set. This is a very nondesctructive layer stack; everything you do to it is on a separate layer and can be turned off or re-edited.
https://maskphoto.com/files/frequency.png

From bottom to top, here's the rundown of the purpose of each layer:
+ Base group
   - Low Frequency: this is the gaussian blur layer, no edits to preserve original image
   - Bandstop: this is the gaussian blur layer with an additional surface blur at 15px and 25px threshold, with an inverted mask to let me paint more smoothness in
   - Smoothen: this lets me airbrush different colors into the low frequency layer in case the bandstop doesn't cut it.

+ Detail group (blend mode: linear add. this lets all the layers in the group contribute to each other before they're blended with the base group
   - High Frequency: this is the original "apply image" layer, no edits to preserve original image
   - Noise: this is the noise from the image, pulled out to a separate layer and then invert-masked. I've found that I need to paint this back in to some detail areas because noise reduction kills some detail. This layer is blend mode: hard light
   - Healing: this layer is where edits to texture and detail go, such as skin retouching.
   - Capture: This is a moderate curves adjustment that only affects the group it's in. its purpose is to capture-sharpen the 3 detail layers below it. It's masked to about 90% black so I can increase the effect where necessary.

+ Retouching group: Any multi-layered retouching would have all layers live in here
   - Edits: this layer is where I'd put any large retouching such as label tags, street signs, backdrop painting, etc.

+ Adjustments group: any curves, saturation, or other adjustment layers that affect a whole image would live in here.
   - Tone: this is a 50% gray soft-light-blended layer for dodging/burning/coloration

+ Sharpen group: linear add blend-mode. this is created after the retouching is finished, and is masked to let me paint in more or less sharpness: "creative sharpening".
   - Amplify is a curves layer that boosts the effect of the sharpness. Can be tweaked to increase sharpness.
   - Difference is basically one last HF layer created with a copy-merge technique. it's a snapshot of the "last good" version of the image. *IF MORE EDITING IS DONE, this layer has to be thrown away and regenerated, BUT the masking from the parent group can be preserved to retain your creative sharpening choices.

Original: completely untouched original image for before/after comparison.


Notes:
* This method results in many layers that can each be switched off until you just have the high- and low-frequency layers (and the noise layer if you want), to give you the original image again (after any liquifying you've done)
* Any liquifying has to be done on a copy of "original" before it's split into frequencies. Otherwise you'd have to liquify twice. seriously, make sure you're done pushing stuff around before you split anything up.
* While healing, It is a minor pain to have to define my clone source on a separate layer, but that's the price i'm willing to pay for this level of nondestructive editing.


Anything not clear? I welcome scrutiny; the more eyeballs on my process, the more i can improve it.
Cheers,
K

Oct 21 09 07:44 pm Link

Photographer

Julian Marsalis

Posts: 1191

Austin, Texas, US

Mask Photo wrote:
- Noise: this is the noise from the image, pulled out to a separate layer and then invert-masked. I've found that I need to paint this back in to some detail areas because noise reduction kills some detail. This layer is blend mode: hard light

How is your noise layer generated? Curious of the settings on creating that.

Oct 22 09 10:35 am Link

Photographer

Mask Photo

Posts: 1453

Fremont, California, US

Julian Marsalis wrote:
How is your noise layer generated? Curious of the settings on creating that.

It's very similar to the frequency separation. Sean Baker mentioned that the Apply Image procedure has broad uses to create deltas between many different before/after procedures.
For the noise layer, I duplicate the background, denoise the bottom layer (I use noiseninja on auto profile but any method you like should work). Then I Apply Image on the top layer, targeting the noiseless layer. I'm left with a layer that has all the noise (and some of the detail; grass and some skin detail are frequently removed when they shouldn't be). I invert-mask it to remove the noise and then paint the removed detail back in.

Oct 22 09 02:58 pm Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Mask Photo wrote:

It's very similar to the frequency separation. Sean Baker mentioned that the Apply Image procedure has broad uses to create deltas between many different before/after procedures.
For the noise layer, I duplicate the background, denoise the bottom layer (I use noiseninja on auto profile but any method you like should work). Then I Apply Image on the top layer, targeting the noiseless layer. I'm left with a layer that has all the noise (and some of the detail; grass and some skin detail are frequently removed when they shouldn't be). I invert-mask it to remove the noise and then paint the removed detail back in.

big_smile  This is also a great way to sharpen, or at least to extract the details which you want to sharpen.  Not recommended for 8bit editing, though it could be done.

Oct 22 09 03:03 pm Link

Photographer

Mask Photo

Posts: 1453

Fremont, California, US

Sean Baker wrote:
big_smile  This is also a great way to sharpen, or at least to extract the details which you want to sharpen.  Not recommended for 8bit editing, though it could be done.

wait, are you saying that the noise layer can be used to sharpen? or are you reaffirming that the frequency separation is good for sharpening?

Oct 23 09 02:02 am Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Mask Photo wrote:

wait, are you saying that the noise layer can be used to sharpen? or are you reaffirming that the frequency separation is good for sharpening?

That one can remove the noise and sharpen the underlying image data (separating it or not, user preference), while retaining fidelity with the original image - not losing the 'grit' or creating unsightly patches from NN or whichever NR engine you employ.  Put another way, you get the edge enhancement that comes with a heavy-handed NR, but without the normal visual artifacting.

Is that any better an explanation?

Oct 23 09 02:13 am Link

Photographer

Mask Photo

Posts: 1453

Fremont, California, US

For the action junkies, here's the trifecta that I've been working with. it seems to go pretty smoothly, though the large number of layers can cause some confusion.

IT WANTS A 16-BIT file to start with. If you don't work in 16 bit, either convert, or find the appropriate step in the action and change it to the 8-bit settings.

If you don't have noiseninja, uncheck it in the 2nd action and check the box next to "reduce noise"

ta-da:
http://maskphoto.com/files/Frequency_Workflow.zip

1. Run "Workspace". Then perform ALL your liquify and distortion edits
2. Run "Frequency Split". Adjust the GB value to something appropriate
3. Do all of your editing. Refer to the layer description in my post above for the purpose of each layer and group
4. Run "Sharpen". Adjust the group's layer mask to taste with, say, levels, then paint areas of greater or lesser sharpness.
5. If you have to do more editing, throw out the "difference" layer in the sharpen group, do your edits, and then run sharpen again and insert the new difference layer. this will preserve your other sharpening choices.

Enjoy.

Oct 23 09 02:38 am Link

Retoucher

Nagfx

Posts: 21

Photo Visions wrote:
I am not going to read all that.

I look to create an image i can enjoy.

You take the joy out of photography.

Huh?

bro you serious, that guy just went out and wrote the best technique to get best settings and the best instead of using high pass filter.. pretty nice technique

that technique will let the photo enjoy more.
...
thanks alot man, also thanks for the action file.
very appreciated for my work. i always keep textures but yesterda i learned about this high pass filter before i was going with other ways to get sharp textures. now learning this is the best day of my life
thanks alot.

Oct 23 09 11:02 pm Link

Photographer

Julian Marsalis

Posts: 1191

Austin, Texas, US

Any math around what Gb or hp settings to use based on mega-pixels of your image? Thinking of making a script that could change the values based on the size of the image. Any thoughts???

Oct 25 09 08:00 am Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Julian Marsalis wrote:
Any math around what Gb or hp settings to use based on mega-pixels of your image? Thinking of making a script that could change the values based on the size of the image. Any thoughts???

I've been thinking about that a bit more again lately, and while I don't think that it's really feasible to do based on overall image size, I was thinking that if one can figure out how to read out the ruler tool's measurements, eye width or inter-pupil distance could be used as a scale reference.  From that, calibration could be taken for the 'typical' offensive frequency range with obliteration and / or replacement of that range in a semi-automated manner.  There'd be grunt work in 'calibrating' the system, but once past the point of figuring out how to read the ruler's values, I think you'd be set to make it work.

Oct 25 09 08:05 am Link

Photographer

Julian Marsalis

Posts: 1191

Austin, Texas, US

SRB Photo wrote:

I've been thinking about that a bit more again lately, and while I don't think that it's really feasible to do based on overall image size, I was thinking that if one can figure out how to read out the ruler tool's measurements, eye width or inter-pupil distance could be used as a scale reference.  From that, calibration could be taken for the 'typical' offensive frequency range with obliteration and / or replacement of that range in a semi-automated manner.  There'd be grunt work in 'calibrating' the system, but once past the point of figuring out how to read the ruler's values, I think you'd be set to make it work.

Mike Hale

You can not script the ruler tool and all you can do with the measurement log is export or delete a measurement.

One way you could do this is to use the line shape tool to make a shape layer for each line. You would then have a visible record of each line that you could toggle off/on. You would also be able to get the start and end points and the length and angle of each line from the shape layer's path in the vector mask.

If you would like to try this way let me know and I will help you script getting the line info.

Mike

PostPosted: Wed Jul 15, 2009 2:29 pm    Post subject:     Reply with quote
The script below with get the line info. The values are in pixels. I think that if the doc's measurement Scale is set you could covert to other units.

You could loop through all the layers and export the data as a csv or xml file.

Or you could append the data to the layer's name. If you are using CS4 you should be able to add the data to the layer's metadata.



Code:
   measureLine = function(path){
   var res = new Array;
   var lineStart = path.subPathItems[0].pathPoints[0].anchor;
   res.push( lineStart );
   var lineEnd = path.subPathItems[0].pathPoints[3].anchor;
   res.push( lineEnd );
   var a = Math.max(lineStart[0],lineEnd[0])-Math.min(lineStart[0],lineEnd[0]);
   var o = Math.max(lineStart[1],lineEnd[1])-Math.min(lineStart[1],lineEnd[1]);
   var c = Math.sqrt((a*a)+(o*o));
   res.push(c);
   var ang = (180/Math.PI) * Math.atan2(o,a);
   if(lineStart[1] < lineEnd[1]){//negative angle
      ang = -ang;
   };
   res.push(ang);
   return res;
   }
// with a line shape layer active and no other paths in the document
var line = measureLine(activeDocument.pathItems[0]);
alert( activeDocument.activeLayer.name + ':\r' + 'Line Start = ' + line[0] + '\rLine End = ' + line[1] + '\rLine Length = ' + line[2] + '\rLine Angle = ' + line[3] );

Maybe lol

Oct 25 09 08:19 am Link

Photographer

Alex Rodriguez gfx

Posts: 103

Anaheim, California, US

A slice of oblivion wrote:
On a website full of Gaussian blurred faces, threads like these never get the praise they deserve.

Thanks for writing this Sean.

yes. thank you!

Oct 25 09 08:34 am Link

Photographer

Sean Baker Photo

Posts: 8044

San Antonio, Texas, US

Julian Marsalis wrote:
Maybe lol

It looks like with some arcane workaround, CS3+4 Extended editions could support this with the measurementLog and recordMeasurements property & method, but obviously that wouldn't work for everyone.  The Line object looks to be a better way to go if this is to be pursued, in the interest of broader compatibility.

Oct 25 09 08:40 am Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

SRB Photo wrote:

It looks like with some arcane workaround, CS3+4 Extended editions could support this with the measurementLog and recordMeasurements property & method, but obviously that wouldn't work for everyone.  The Line object looks to be a better way to go if this is to be pursued, in the interest of broader compatibility.

I've been thinking hard on this idea also. The method I would use would be for someone to simply use the rectangular tool to make a loose selection around a single eye. The scripting language can easily figure out the dimensions of a selection box.

And.....I am almost finished with something I believe you're going to like. smile

Oct 25 09 06:06 pm Link

Retoucher

Natalia_Taffarel

Posts: 7665

Buenos Aires, Buenos Aires, Argentina

You're both so geeky!!!

I'm getting all excited wink

/me loves the smart ones!

x

Oct 25 09 06:17 pm Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Natalia_Taffarel wrote:
You're both so geeky!!!

I'm getting all excited wink

/me loves the smart ones!

x

I get excited when I'm allowed to be geeky. tongue

And I finished a script. It's basically the script Sean just posted to allow for multiple frequency separations but I pumped it up with the script equivalent of anabolic steroids.

It can be found here

You will get a dialog when you run this and this same dialog will come up for each iteration of separating. The first time you will be asked to Begin Separation? and after to Continue Separating? Simple click YES to separate and NO to stop the script.

There are 3 checkboxes. One for clipped curves and this is the same as Sean had it. This will clip a curves to the High Frequency layer and is set to on by default. The next checkbox is for creating a new group. If you wish to place your separated layers into groups, check this box. The group will have a mask attached to it and this is what the third checkbox is for...if you want that mask inverted you check here.

Why did I do that? I've found it easier to work on the separated layers in groups and there are times when I don't want the whole layer to show the effects of the separation so in order to selectively apply this, I group the layers and mask the group. You can create as many groups and/or separations as you want. If you create a group, all separations from that point until you make a new group will go into that group stacked as per Sean's script.

One difference with this script: It shows the Gaussian Blur dialog to allow you to adjust the GB radius for each iteration and the layer names will match the frequency band as well as the clipped curves layers. I didn't name the groups, though. I'm lazy. big_smile

Hope you all enjoy it. I had fun making it.

Oct 25 09 06:58 pm Link

Retoucher

Natalia_Taffarel

Posts: 7665

Buenos Aires, Buenos Aires, Argentina

Photons 2 Pixels Images wrote:

I get excited when I'm allowed to be geeky. tongue

And I finished a script. It's basically the script Sean just posted to allow for multiple frequency separations but I pumped it up with the script equivalent of anabolic steroids.

It can be found here

You will get a dialog when you run this and this same dialog will come up for each iteration of separating. The first time you will be asked to Begin Separation? and after to Continue Separating? Simple click YES to separate and NO to stop the script.

There are 3 checkboxes. One for clipped curves and this is the same as Sean had it. This will clip a curves to the High Frequency layer and is set to on by default. The next checkbox is for creating a new group. If you wish to place your separated layers into groups, check this box. The group will have a mask attached to it and this is what the third checkbox is for...if you want that mask inverted you check here.

Why did I do that? I've found it easier to work on the separated layers in groups and there are times when I don't want the whole layer to show the effects of the separation so in order to selectively apply this, I group the layers and mask the group. You can create as many groups and/or separations as you want. If you create a group, all separations from that point until you make a new group will go into that group stacked as per Sean's script.

One difference with this script: It shows the Gaussian Blur dialog to allow you to adjust the GB radius for each iteration and the layer names will match the frequency band as well as the clipped curves layers. I didn't name the groups, though. I'm lazy. big_smile

Hope you all enjoy it. I had fun making it.

ok... I got a lot of coding when i touched the link... codes scare me... what do i do with that? :$

Oct 25 09 07:36 pm Link

Photographer

Julian Marsalis

Posts: 1191

Austin, Texas, US

Natalia_Taffarel wrote:

ok... I got a lot of coding when i touched the link... codes scare me... what do i do with that? :$

Right click and save as its a text file MultiDecomp.jsx which is the script and place it in your scripts preset folder and viola you have the latest.

Oct 25 09 08:07 pm Link

Photographer

Photons 2 Pixels Images

Posts: 17011

Berwick, Pennsylvania, US

Natalia_Taffarel wrote:
ok... I got a lot of coding when i touched the link... codes scare me... what do i do with that? :$

Retouching scares me. But I'm a wimp. wink Maybe that's why I spend a lot of time writing scripts for Photoshop and not much retouching.

Julian Marsalis wrote:
Right click and save as its a text file MultiDecomp.jsx which is the script and place it in your scripts preset folder and viola you have the latest.

This works. Or, go under File>Save Page As...(Firefox) or File>Save As (Internet Explorer). In IE, you may have to delete the .mht extension so the filename is "MultiDecomp.jsx".

Save it into your Photoshop/Presets/Scripts folder and restart Photoshop. It will then be available under File>Scripts>MultiDecomp

Oct 25 09 08:24 pm Link

Photographer

Mask Photo

Posts: 1453

Fremont, California, US

Has anyone given any thought as to whether a variant of this method is any good for output sharpening? Or is the good old unsharp mask still the best tool in the shed for that? Or am i totally off-base? (i tried Nik Sharpener Pro but it effed up sharpen for screen so badly that I never wanted to try it for printing)

Oct 25 09 11:25 pm Link