High Pass Sharpening / Contrast Enhancement

  • Ioxa
  • Topic Author
More
8 years 11 months ago - 8 years 1 month ago #1 by Ioxa High Pass Sharpening / Contrast Enhancement was created by Ioxa
While looking for ways to reduce the "halo" or "ringing" caused by unsharp masking I came across some information on a different method of sharpening called high pass sharpening. After a couple visits to Wikipedia I had a method for creating a high-pass filter and some equations for different blend modes, put it all together and this is the result. It is still very much a work in progress but in the limited testing I've done it seems to be working. I know very little about coding, so if you spot any mistakes or have any recommendations to help me improve this please let me know.

Some before and after pictures. The best way to view these is to open each in a separate tab so you can quickly switch between them (HINT: Click on the image with the middle mouse button). Keep in mind that these were taken while using high settings to make the differences easier to spot.

Clarity (Formerly Contrast Enhancment).
Warning: Spoiler!


Updated March/10/2016
Shaders compatible with ReShade 2.0 and the new ReShade Assistant can be found at the link below.
reshade.me/forum/shader-presentation/529-high-pass-sharpening-contrast-enhancement?start=120#13280
I have too many links on this page so you'll have to copy and paste it.

Updated Jan/25/2016
Download ioFX v1.2 for ReShade + Framework

I added a Bilateral Filter and made a few changes to the Clarity and High Pass Sharpening shaders. I didn't do a whole lot of testing with it so let me know if anything isn't working.

Install Instructions for ioFX for Reshade + Framework

1. Make sure the Framework Mediator is not running.
2. Copy the ReShade folder to the folder that ReShade was installed to and merge it with the existing ReShade folder.
2.a) Overwrite the existing Pipeline.cfg or manually add the following lines to the existing Pipeline.cfg.

#include EFFECT(ioFX, Sharp)
#include EFFECT(ioFX, Clarity)
#include EFFECT(ioFX, BilateralFilter)
#include EFFECT(ioFX, ChroAb)
#include EFFECT(ioFX, ColorFilter)

3. Open the Mediator and enable the effects in the Pipeline tab. Adjust the shader settings in the ioFX tab.

Updated June/26/2015
Download High Pass Sharpening / Contrast Enhancement for ReShade + SweetFX and MasterEffect

Install Instructions for ReShade + SweetFX

1. Copy ReShade.fx and the SweetFX folder to the same folder that ReShade was installed to.
Overwrite the existing ReShade.fx and merge the SweetFX folder with the existing SweetFX folder.

2. Open the SweetFX folder and find HighPass_settings.h.
Open the file and scroll down to the line that says "#define Compatibility".
Set it to 1 to use in combination with SweetFX or 2 to use in combination with MasterEffect.
*If using with MasterEffect rename MasterEffects ReShade.fx file to ReShadeME.fx.
Last edit: 8 years 1 month ago by Ioxa. Reason: Update
The following user(s) said Thank You: crosire, Wicked Sick, SiriusHours, Marty McFly, BillyAlt, Quentin-Tarantino, BrandonHortman, jas01, NotAgOat, Coolwhip and 9 other people also said thanks.

Please Log in or Create an account to join the conversation.

  • Wicked Sick
More
8 years 11 months ago - 8 years 11 months ago #2 by Wicked Sick Replied by Wicked Sick on topic High Pass Sharpening
Ioxa, I have tried this one with a few games and I got a crash in all of them. I am guessing that I did something wrong, even though I have tried to follow your instructions with much attention.
I have tried it with The Witcher 2, GTA IV and Dark Souls 2 (the x64 one) and all of these crashed shortly after being ran.

Please, look here: i.imgur.com/sFFFDKP.png

I think I have done it all right, unless that leaving at the very bottom the #include EFFECT(CustomFX, Sharp) does influentiate in something if not being placed in somewhere near the bottom instead. But I guess not, I don't know, perhaps yes, or not...

Sorry for always be bringing to you bad news.
Last edit: 8 years 11 months ago by Wicked Sick.
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 11 months ago - 8 years 11 months ago #3 by crosire Replied by crosire on topic High Pass Sharpening

Wicked Sick wrote: Ioxa, I have tried this one with a few games and I got a crash in all of them.

A shader alone shouldn't never produce a crash ....
There's a bug in ReShade's preprocessor though, which can cause a crash if there is no new line at the end of a file and the last line is a "#include" directive. So yeah, try to add a new line after the "#include EFFECT..." thing.
Last edit: 8 years 11 months ago by crosire.
The following user(s) said Thank You: Wicked Sick, Ioxa, Coolwhip

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #4 by Ioxa Replied by Ioxa on topic High Pass Sharpening
Your guess was right Wicked, having that line at the very bottom causes the crash, good to know for the future. When I added it I put it at line 46, just under the gaussian shader. If you don't bring the bad news someone else will.

Please Log in or Create an account to join the conversation.

  • Wicked Sick
More
8 years 11 months ago #5 by Wicked Sick Replied by Wicked Sick on topic High Pass Sharpening
Yeah, I did what Crosire said, pressed enter after the #include EFFECT(CustomFX, Sharp) leaving blank line. No more crashes.

Also, with this release of ReShade, or perhaps the game had an update and I didn't see it, but now I can start Dark Souls 2 SoTFS straight from my library instead of going into the .exe's folder and running it as an administrator.

I will try it, ioxa, thank you for making this.

Please Log in or Create an account to join the conversation.

  • Kleio420
More
8 years 11 months ago #6 by Kleio420 Replied by Kleio420 on topic High Pass Sharpening
this looks nice , loxa it works where you said to place it btw

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #7 by Ioxa Replied by Ioxa on topic High Pass Sharpening
Updated the OP with a new version and some pictures, I'll post them here too.

Download

Some pictures showing how high pass sharpening works and the difference between a few of the blend modes. Keep in mind these pictures were taken while using very high settings to make the differences easily noticeable.
Warning: Spoiler!
The following user(s) said Thank You: BillyAlt, BrandonHortman, Coolwhip

Please Log in or Create an account to join the conversation.

  • BillyAlt
More
8 years 11 months ago - 8 years 11 months ago #8 by BillyAlt Replied by BillyAlt on topic High Pass Sharpening
Another impressive shader, loxa.

The low "SharpPrecision and high SharpQuality" filter looks like it has some really nice local contrast. I'll have to test this one out.
Last edit: 8 years 11 months ago by BillyAlt. Reason: spelling

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #9 by Ioxa Replied by Ioxa on topic High Pass Sharpening

BillyAlt wrote: Another impressive shader, loxa.

The low "SharpPrecision and high SharpQuality" filter looks like it has some really nice local contrast. I''ll have to test this one out.

Thanks Billy!

After your post about micro contrast and local contrast I've been looking at different photo editing techniques for ideas. From what I've read I think that one you're talking about would be considered local contrast enhancement. For that picture I think I had SharpPrecision at 0.30 and SharpQuality at 3 and I used the overlay blend mode. Soft light would probably work pretty well too but with the others the dark areas start bleeding over into the lighter areas, it looks really bad.
The following user(s) said Thank You: BillyAlt

Please Log in or Create an account to join the conversation.

  • BillyAlt
More
8 years 11 months ago - 8 years 11 months ago #10 by BillyAlt Replied by BillyAlt on topic High Pass Sharpening
Yes, you're right, it is indeed local contrast enhancement! Photo editing techniques are a great place to look for ideas for shaders. I recommend playing around with GIMP: www.gimp.org/

Thanks for sharing those numbers, I had attempted to replicate the look just from eyeballing it. I gotta pretty close -- I had SharpPrecision at .40 and SharpQuality at 6, with the multiply blend mode.
Last edit: 8 years 11 months ago by BillyAlt.
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

  • BrandonHortman
More
8 years 11 months ago #11 by BrandonHortman Replied by BrandonHortman on topic High Pass Sharpening
This is rad, thanks!
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #12 by Ioxa Replied by Ioxa on topic High Pass Sharpening

BillyAlt wrote: Yes, you're right, it is indeed local contrast enhancement! Photo editing techniques are a great place to look for ideas for shaders. I recommend playing around with GIMP: www.gimp.org/

Thanks for sharing those numbers, I had attempted to replicate the look just from eyeballing it. I gotta pretty close -- I had SharpPrecision at .40 and SharpQuality at 6, with the multiply blend mode.


The multiply blend mode actually doesn't look too bad for it, maybe a little on the bright side but that could be adjusted.
I'm thinking of adding a separate section of settings just for contrast enhancement, that way the settings could be geared more for doing that instead of sharpening. I could also get rid of the blend modes that don't work well for it or modify them so they work better. Would also allow sharpening and contrast enhancement to be used together, I was trying it with lumasharpen and it looked pretty good.
The following user(s) said Thank You: Scorpio82CO

Please Log in or Create an account to join the conversation.

  • Scorpio82CO
More
8 years 11 months ago - 8 years 11 months ago #13 by Scorpio82CO Replied by Scorpio82CO on topic High Pass Sharpening
some results with your shader.. thanks!! looks really nice

[img


[img


multiply type high qlty sharp with low pres..
Last edit: 8 years 11 months ago by Scorpio82CO.
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

  • Constantine PC
More
8 years 11 months ago #14 by Constantine PC Replied by Constantine PC on topic High Pass Sharpening
Those two screenshots really impressed me with what this is capable of doing. I'll have to give this a go, thanks for sharing dude.

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #15 by Ioxa Replied by Ioxa on topic High Pass Sharpening

Scorpio82CO wrote: some results with your shader.. thanks!! looks really nice

Warning: Spoiler!


multiply type high qlty sharp with low pres..

Thanks for sharing! Its nice to see this being put to good use!

Please Log in or Create an account to join the conversation.

  • Scorpio82CO
More
8 years 11 months ago #16 by Scorpio82CO Replied by Scorpio82CO on topic High Pass Sharpening
only half to apply to rage... but it doesnt work.....can you help me with it?

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #17 by Ioxa Replied by Ioxa on topic High Pass Sharpening
Is it the shader that isn't working or ReShade itself?

Please Log in or Create an account to join the conversation.

  • BillyAlt
More
8 years 11 months ago #18 by BillyAlt Replied by BillyAlt on topic High Pass Sharpening
I decided to go in the complete opposite direction of Scorpio and make something beautifully gaudy:


I tried to replicate the lofi 80s look of this music video:


The local contrast enhancement seals the deal, I think
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

  • Ioxa
  • Topic Author
More
8 years 11 months ago #19 by Ioxa Replied by Ioxa on topic High Pass Sharpening

BillyAlt wrote: I decided to go in the complete opposite direction of Scorpio and make something beautifully gaudy:

Warning: Spoiler!


The local contrast enhancement seals the deal, I think


Haha, nice! Looks like a completely different game, looks like everything is covered in neon lights! I had never heard of Kung Fury, looks like they nailed that cheesy 80's thing they were going for.
The following user(s) said Thank You: BillyAlt

Please Log in or Create an account to join the conversation.

  • BrandonHortman
More
8 years 11 months ago #20 by BrandonHortman Replied by BrandonHortman on topic High Pass Sharpening
I used High Pass Sharpening in my Dragon Age Inquisition Preset here
www.nexusmods.com/dragonageinquisition/mods/438/ ?

I credited to you :cheer:

Great work
The following user(s) said Thank You: Ioxa

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.