HIGH-PASS FILTER

Luna

Posts: 2

1 year ago

Hi,
I love retouching some photos, and I think that Pixelmator should really add the high-pass filter, that' s an essentiel filter to retouch the skin correctely, and really more natural and precise than just with the gaussian blur.

Luna
IamSam

Posts: 90

1 year ago

I don't know if this is the same one that Sebastiaan has sent you, but I found this High-Pass filter that was made for Pixelamator, I have not tried the filter, but the link works fine.

http://dl.dropbox.com/u/2808873/PixelmatorHighPass.zip


Here is a so-so tutorial on the High-Pass filter effect:

http://adam.merrifield.ca/2010/07/23/ge ... ixelmator/

As Sebastiaan stated, your request for a dedicated High-Pass filter is a much needed addition to Pixelmator.
Luna

Posts: 2

1 year ago

Thanks a lot to you two!!! I will try so! :)
But in the meantime, I still hope they will do so that it will be easier to use!! :)
Thanks! ^^
abib.b

Posts: 6

1 year ago

Hello -

I have been experimenting with the frequency separation technique and have found a way to do it in PM. You can also try this:


Definitions

Linear Dodge. LD (v1,v2) = min (v1+v2,1)
Linear Burn LB (v1,v2) = if (v1+v2<1,0,v1+v2-1)
Linear Light LL (v1,v2) = if (v1<0,5,LB(v2,2*v1),LD(v2,2*(v1-0.5)))

Three Layer Separation.

This separates an image into a low frequency colour layer and two high frequency layers, one dark, one light

Let bl = base layer
c = Colour layer

Create the LF Colour layer using Gaussian blur with a given radius. For the dark HF layer, create merged max(bl-c,0) layer above LF colour layer. Use Linear Dodge as blending mode.

For the light HF layer, copy a base layer above an inverted colour layer copy. Use Linear dodge as blending mode and merge two layers. Label this HFL. Finally use Linear Burn blending mode to the HFD layer below. Separation is complete.

There is an highlight/dark artifact around the edge of the frame, equal to the Gaussian blur radius that seems to come from the behaviour of Gaussian Blur at the edges of a frame. It is as if GB uses value zero for off frame pixels rather than the average of the remainder or the point pixel value.


Two layer separation.

This is more involved to set up but is much easier to use and is equivalent to the popular Photoshop 2/128 frequency separation technique. The key to this is to create, in stages, a layer that is 0.5*(1+bl-c). Then Linear Light blending mode with the Colour layer recovers the image.

The mathematics works fine.

LL (0.5*(1+bl-c),c) = LB (c, 1+bl-c) = bl, if 0.5*(1+bl-c) < 0.5)
= LD (c,1+bl-c-1) = bl, otherwise

0.5 * (1+bl-c) = 0.5 * (1+max(bl-c,0) + min (bl-c,0))
= 0.5 * (1+max(bl-c,0) - max (c-bl,0))

Therefore,

1. Create a colour layer with an assigned Gaussian Blur
2. Then create max(bl-c,0), merge, create two 50% gray layers, first multiply then add to create 0.5*(1+max(bl-c,0)), merging each time. Adding is the same as Linear Dodge.
3. Next create max(c-bl,0), merge; create another 50% gray layer, multiply and merge.
4. Subtract 3 from 2. Merge
5. Use Linear Light blending mode with the colour layer
Separation is complete.

Note that to create max(bl-c,0), the c layer needs to be above the bl layer in the layer stack for the Subtract blending mode.
Zaphodz

Posts: 25

11 months ago

Thanks for this abib.b, tried to do the two layer version but couldn't follow the instructions, would it be possible to add more explanation to them, would be much apprciated! +1 for this feature request btw.

Thnaks - Zaphodz
abib.b

Posts: 6

11 months ago

Sure.

The important thing to realise is that when you Subtract two layers - say a-b - the result has a minimum value at 0 even if, at that pixel, b>a. i.e. since pixels can only take a value form 0-255 there is an implicit floor at zero for the Subtract blending mode. Hence my notation.

Max (bl-c,0) is therefore nothing more than using the Subtract blending mode to subtract c from bl. All the complexity above is there to get around this zero floor limitation, and it's there because one has to do it in two steps: first, for the situation where the pixel in bl > c and one where bl < c.

The 0.5* multiplier is there so that the full range of the difference is still within the 0-255 range. Since the result of the subtraction can range from -255 to 255 you have multiply it by 1/2 to rescale it to -127/127 and and then to shift it so that the zero middle is rebased to 127. That way, you fit the permissible range. This is what Photoshop is doing with the 2/128.

Notation:

let bl be your base layer
let C be the blurred "colour" layer
let g be a 127/127/127 constant gray layer (use 128 if you prefer).

Therefore:

1. Duplicate bl twice, label the top one C and blur it with Gaussian blur, say at 10 pixels radius. Layers are now bl, bl, C.
2. Duplicate C and rearrange layers so that you have bl, C, bl, C
3. Now, on top C, set blending mode to Subtract and merge the top two layers. You now have bl, C, max(bl-C,0)
4. Now create two 50% gray layers. The layer stack should now be bl, C, max(bl-c,0), g, g.
5. On the lower g layer, set blending mode to Multiply and merge with the layer below it. You now have bl, C, 0.5*max(bl-c,0), g
6. Now, on the top g layer set blending mode to Linear Dodge and merge with the layer below. Layer stack is now bl, C, 0.5 + 0.5 * max(bl-C,0)

7. Now duplicate both bl and C and rearrange so that the stack looks like bl, C, 0.5 *(1+max(bl-c,0)), C, bl.
8. Set the blending mode for the top bl layer to Subtract and merge top two layers.
9. Layer stack is now bl, C, 0.5*(1+max(bl-C,0)), max(C-bl,0).
10. Create a 50% gray layer at the top. Set its blending mode to Multiply and merge with the layer below.
12. Layer stack is now bl, C, 0.5*(1+max(bl-C,0), 0.5*max(C-bl,0). Set the Blending mode of the top layer to Subtract and merge top two layers
13. Layer stack is now bl, C, 0.5*(1+bl-c) - this is a result of the mathematics shown in the first post.
14. Set Blending Mode on the top layer to Linear Light.

Separation is complete and the image is recovered in two layers.

The two things to be aware of are that: (i) if you use 50% gray from the colour picker it picks 145/145/145, not 127/127/127 and that to subtract C from bl you need to have C above bl in the layer stack.

The steps you need to take look complicated but, once you understand that you are trying to get to a layer that is 0.5 * (1+bl-C) without clipping any pixels, it becomes very clear what those steps are doing, why they are necessary and why you have to do them in that order.

I hope this helps.
Zaphodz

Posts: 25

11 months ago

Many thanks for this abib.b, will give it another try :-)
abib.b

Posts: 6

10 months ago

You can actually also reduce the number of merges to 3: after step 6, step 10 and step 12.

Please sign in to post.