Skip to main content

Color Luminance Map Script

What it Does

For this entry we will cover how to run the Color Luminance Map Script.  This script takes a simple png (the map) and takes all the colors along a row and maps them to the luminance for each pixel on another image (sort of like an advanced Colorize).



Install Python

If you don't have Python installed already, you will first need to install Python.

Download the Script

You can find the script and some example images in github here: https://github.com/makeshoppro/psp_tools/tree/master/color_luminance_map

Click on the color_luminance_map.py file.

On the new screen right-click on the [RAW] button and select Save Link As...

To download the example images, simply click on them and then click the [Download] button.  When the image is presented, you can right-click on them and select Save Image As...

Install a library

To the run the script, you'll need to install one library.  If you have installed this library for another script, you can skip this step.

First we need to open a command prompt.  To do this, you can type cmd in the address bar as show below.  And when you hit [Enter] a command prompt should come up.


In the command prompt, simply type pip install imageio

If you have the library installed already, you'll see the following screen.  If not, you'll see the library begin to install.


Run the Script

Now that we've installed the necessary library, in the same command prompt window we can test the script out by typing the following command:

   python color_luminance_map.py bw.png skin_map.png

and if the script runs as expected, you should see the following output:


Once the script completes a new file colored_img.png should be generated.

If this does not work, you may need to retrace your steps and see if you missed any details along  the way.

Making your Own Map

When creating your own map file, recognize that the dark pixels of the image will correlate with the pixels on the left side of the map image, and the lighter pixels will correlate with the right side of the map image.

The map image must be 255 pixels in width, but can be any height at least 1 row high.

This script is meant for creating more realistic skin tones, but it can also be used to generate creative effects.  For example, using a rainbow map produced this image:


Comments

Popular posts from this blog

Get a Python Script from Github

How to Pull Down a Python Script from Github This entry will cover how to pull down a script generated by MakeShopPro from github.  See the youtube channel for specific scripts and what they do:  MakeShopPro Youtube Channel You'll need to Install Python , before doing the following steps. Github Click on the link provided by the youtube video  (for this example you can use this script ) From the github page, find the *.py file and click on it.  In the example below, click on the PhotoMosaic.py To download the script right-click on the [Raw] button and select Save Link As... Choose a location to save the script. Install Libraries Sometimes scripts require extra libraries/modules to be installed for them to run.  Most of the libraries (but not all) come with the Python install.  If the video calls out an extra script to be added the following procedure is how to install them. Open a command prompt (doesn't matter the location) ...

Pic2Painting in v2021 and Later

To find the Pic2Painting capability, it has moved to the Adjust workspace, and can be accessed under the Instant Effects palette. See image below. This information applies for versions of PaintPhop Pro 2021 or later. For earlier versions, Pic2Painting is treated as a plugin.

PhotoMirage Express Tips

PhotoMirage Express Tips See the youtube video here:   PhotoMirage Tips In this tutorial we're going to go over some tips for using PhotoMirage.  In general, I have a preference for making cinemagraphs that have some manner or realism to it (which is what my tips emphasize), but of course, you can experiment with it and use it how you like. This is not a basic tutorial on how to use the program, but seeks to expose some of its behaviors and some techniques that I've found useful. Fast Grid Image As part of discovering how PhotoMirage works, I did some testing on a grid image.  So the first part of this tutorial is showing you how to quickly create a grid image. In PaintShop Pro open a new image with a transparent background .  This should appear in Paintshop Pro as a grid. Screen Capture or use the Windows Snip tool to save that image. Now we have a simple grid we can test with. Basic PhotoMirage Tips The following are some ...