Welcome, Guest.
Username: Password: Remember me

TOPIC: High Pass Sharpening / Contrast Enhancement

High Pass Sharpening / Contrast Enhancement 1 year 7 months ago #1

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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! [ Click to expand ]


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 months 4 weeks ago by Ioxa. Reason: Update
The administrator has disabled public write access.
The following user(s) said Thank You: crosire, Wicked Sick, SiriusHours, Marty McFly, BillyAlt, Quentin-Tarantino, BrandonHortman, jas01, NotAgOat, Coolwhip and this user have 9 others thankyou

High Pass Sharpening 1 year 7 months ago #2

  • Wicked Sick
  • Wicked Sick's Avatar
  • Offline
  • Die young or suffer (Forgive my poor English)
  • Posts: 360
  • Thank you received: 105
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.
Finding relief somewhere between a tree's branch and its shade.
Last Edit: 1 year 7 months ago by Wicked Sick.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

High Pass Sharpening 1 year 7 months ago #3

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2453
  • Thank you received: 1393
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.
Cheers, crosire =)
Last Edit: 1 year 7 months ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: Wicked Sick, Ioxa, Coolwhip

High Pass Sharpening 1 year 7 months ago #4

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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.
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #5

  • Wicked Sick
  • Wicked Sick's Avatar
  • Offline
  • Die young or suffer (Forgive my poor English)
  • Posts: 360
  • Thank you received: 105
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.
Finding relief somewhere between a tree's branch and its shade.
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #6

  • Kleio420
  • Kleio420's Avatar
  • Offline
  • Posts: 217
  • Thank you received: 28
this looks nice , loxa it works where you said to place it btw
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #7

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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! [ Click to expand ]
The administrator has disabled public write access.
The following user(s) said Thank You: BillyAlt, BrandonHortman, Coolwhip

High Pass Sharpening 1 year 7 months ago #8

  • BillyAlt
  • BillyAlt's Avatar
  • Offline
  • Posts: 42
  • Thank you received: 9
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: 1 year 7 months ago by BillyAlt. Reason: spelling
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #9

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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 administrator has disabled public write access.
The following user(s) said Thank You: BillyAlt

High Pass Sharpening 1 year 7 months ago #10

  • BillyAlt
  • BillyAlt's Avatar
  • Offline
  • Posts: 42
  • Thank you received: 9
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: 1 year 7 months ago by BillyAlt.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

High Pass Sharpening 1 year 7 months ago #11

This is rad, thanks!
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

High Pass Sharpening 1 year 7 months ago #12

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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 administrator has disabled public write access.
The following user(s) said Thank You: Scorpio82CO

High Pass Sharpening 1 year 7 months ago #13

some results with your shader.. thanks!! looks really nice





multiply type high qlty sharp with low pres..
Last Edit: 1 year 7 months ago by Scorpio82CO.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

High Pass Sharpening 1 year 7 months ago #14

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.
I'm always learning.
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #15

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
Scorpio82CO wrote:
some results with your shader.. thanks!! looks really nice

Warning: Spoiler! [ Click to expand ]


multiply type high qlty sharp with low pres..
Thanks for sharing! Its nice to see this being put to good use!
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #16

only half to apply to rage... but it doesnt work.....can you help me with it?
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #17

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
Is it the shader that isn't working or ReShade itself?
The administrator has disabled public write access.

High Pass Sharpening 1 year 7 months ago #18

  • BillyAlt
  • BillyAlt's Avatar
  • Offline
  • Posts: 42
  • Thank you received: 9
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 administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

High Pass Sharpening 1 year 7 months ago #19

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
BillyAlt wrote:
I decided to go in the complete opposite direction of Scorpio and make something beautifully gaudy:
Warning: Spoiler! [ Click to expand ]


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 administrator has disabled public write access.
The following user(s) said Thank You: BillyAlt

High Pass Sharpening 1 year 7 months ago #20

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 administrator has disabled public write access.
The following user(s) said Thank You: Ioxa