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

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.

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) Enter the command: pi

Youtube Subtitles for Other Languages

The following is an instruction on how to view Make Shop Pro videos but with subtitles in a different languages.   First click the settings icon (gear) Click on the Subtitles/CC option Click on English (auto-generated) Click on this modified button Subtitles/CC English(auto-generated) Click Auto-translate Select your language You should now see subtitles (that may or may not be that accurate) that are a translation of the auto-subtitles generated in english.