Sign in to follow this  

TR's HDR-ish

Recommended Posts

TechnoRobbo's HDR-ish


HDR style results - smooths out the transitions between light and dark.

makes a dull picture less dull


PDN 3.5 compatible (updated)










The Codelab Code

Hidden Content:

// Submenu: Color

// Name: TR's HDR-ish

// Title: TR's HDR-ish- v1.0

// Author: TechnoRobbo

#region UICode

int Amount1 = 2; // [1,5] Intensity

double Amount2 = 0; // [0,20] High Limit



void Render(Surface dst, Surface src, Rectangle rect)


    ColorBgra CP;

    int tmp =0;

    for (int y = rect.Top; y < rect.Bottom; y++)


        for (int x = rect.Left; x < rect.Right; x++)


            double accum = 0;

            double divider = 0;

            for (int i = 1 - Amount1 ;i <Amount1; i++)


                for (int j = 1 - Amount1 ;j <Amount1; j++)


                    CP = src.GetBilinearSampleClamped(x + j,y + i);


                    HsvColor hsv = HsvColor.FromColor(CP.ToColor());

                    accum += hsv.Value;




            CP = src[x,y];

            HsvColor hsv2 = HsvColor.FromColor(CP.ToColor());

            divider += Amount2;

            divider = (divider <= 1) ? 1 : divider;

            double newV = accum / divider;

            newV -= (1-hsv2.Value);

            newV = (newV < 0) ? 0 : (newV > 100) ? 100: newV;

            hsv2 = new HsvColor(hsv2.Hue,hsv2.Saturation,(int)newV);

            ColorBgra NP = ColorBgra.FromColor(hsv2.ToColor());

            dst[x,y] = NP;




Edited by TechnoRobbo
  • Upvote 2

Share this post

Link to post
Share on other sites

EER went through all the plugins and placed a note in red at the top of the first thread for every plugin incompatible with PDN4.  If you find that it needs one, let me know and I'll add it.

Share this post

Link to post
Share on other sites

I didn't check them all. Some filetypes and a handful of rarely used effects didn't get the treatment.

As David said - please let us know if you find one that doesn't work.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this