Parametric Curves free script User Guide

Davide Barranca — 
Parametric Curves is a free Photoshop script that lets you plot mathematically defined (Javascript) Curves Adjustment layers. If you wonder what they could be for, please read my previous post called “Gradients and Parametric Curves in Photoshop”.

Here I’ll show you the script interface and I’ll walk you through the creation of some interesting Curves, that will be the building blocks of advanced creative manipulations.

Where do I get it?

Adobe ExchangeParametric Curves is available for Photoshop CS6 (Mac/Win) through Adobe Exchange – the new in-app, app-store panel made by Adobe itself. Download and install Exchange if you don’t already have it, then browse the Free extensions and look for Parametric Curves there.

Install Parametric Curves, and find it in the Photoshop Filter menu.

How does it work?

When you launch it, a Curves Adjustment layer is build behind the scene and the Parametric Curves window pops up: you can either pick up a ready made function from the Presets or write your own Javascript in the text area. Click Try to preview the curve, Apply to eventually confirm.

Interface

Parametric Curves interface

1 – Curve

This is where the curve is graphed. By default the orientation is Light – that is to say Black (0) is bottom-left, White (255) is top-right, which is the default of RGB and Lab modes; you can switch to Pigment / Ink % (the default for Grayscale and CMYK, White is bottom-left and Black is top-right) with the Display option drop-down menu.

2 – Presets

Parametric Curves PresetsThere are some ready-made Curves you can try in the drop-down menu “Select a preset…”. When you choose one, the function is pasted in the text area (3) and the curve displayed (1).

You’re allowed to save your own Preset clicking the New button (you’ll be asked to enter a label for it). Add as many presets as you want – you can always delete the one you don’t like (but the Default ones) with the Remove button, or Reset them to the default group.

3 – Functions

In this text area you can write your own functions, or modify existing ones. Once you’re done, click the Try button in order to test it either as a graph in the Curve panel and as an actual Curves Adjustment Layer in the file.

4If you’re satisfied with the result, click the Apply button, otherwise you can tweak the function of Cancel back to Photoshop.

4 – Information

The Math Ref. button (which can be toggled on/off) shows a handy reference for the Math. Javascript Object (see below for more information):

Parametric Curves Math reference

The Tutorial button points your browser to the Parametric Curves category page of this website, while the ? button shows copyright informations.

Functions Tutorial

This will help you starting with your own functions. Few basic information:

  • The full range is 0-255, where Black = 0 and White = 255 (this is independent on the Display option).
  • Functions are in the form: y = f(x) and you’re supposed to write the f(x) part only: so the default Curve (a straight line 45°) is just “x”.
  • Functions value is automatically rounded.
  • Javascript syntax is allowed.
  • More complete Javascript reference is here.

I’m not very good with geometry so let’s start simple:

Functions 1

x+127
x-127
2*x
x/2

If you need constants, they must be written as in this example: Math.PI * x + Math.LN2.

You can write functions as well of course:

Functions 2

Math.pow(x,2) / 70
40*Math.log(x)
255*Math.random()
x+30*Math.sin(x/5)

You’d better off normalizing the output to fit the 0-255 range, as in the following examples:

Functions 3

Math.sin(x)
127*Math.sin(x)
127*Math.sin(x) + 127
127*Math.sin(2*Math.PI*x/255) + 127

You can also use:

  • The so-called ternary operator, in the form of (condition) ? (true) : (false).
  • The modulo operator %, for instance x%10 (which gives the rest of the division by 10 and it’s useful to repeat patterns)
  • Logic operators && (and) || (or), besides == (equal to) and != (not equal to), < and >
  • Nest them when needed, but be careful not to write bad code!
Functions 4

(x>128) ? x : 255 – x
4 * x%256
(((x>0) && (x<64)) || ((x>128) && (x<191))) ? x : 255-x
x / a

Anything a bit more inspirational on the Creative side?

It’s a bottomless pit as soon as you start experimenting – please see this post full of examples.

Parametric Curves Funky Stuff

Go get it!

Find it on Adobe Exchange, it’s free! And if you think that after all it’s a nice piece of software, please leave a review in Exchange.


Print Friendly
Share

7 responses to Parametric Curves free script User Guide

  1. Impressive script! I like the graph display.
    I got it running on a Mac at work, but on my PC at home, the Adobe Exchange panel is getting stuck with a “Logging in…” message.

    It would nice if you could re-open a curve layer made with the script, and adjust the formula.

    And a very minor thing…
    The name of the “Apply” button isn’t consistent with dialogs in other programs. Usually an Apply button will update settings, while keeping the dialog/window open. The script’s “Apply” button, on the other hand, doesn’t update the settings when I edit a formula, and it closes the dialog. The “Try” button seems closer to what an Apply button usually does (except that the curve layer is deleted if you cancel or escape out of the Dialog)

  2. Where can i get a copy of this without going to adobe exchange? any other mirrors?

  3. i love this but have no idea regarding the math side of it :) I dont suppose you could add a “randomize” button or something that could autogenerate a curve?

Trackbacks and Pingbacks:

  1. 20 Great Time-Saving Photoshop Scripts - June 20, 2013

    […] Parametric Curves […]

  2. The 30 Most Useful Free Photoshop Scripts - December 25, 2013

    […] Parametric Curves […]