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

Vector Graphic Drawing in PaintShop Pro

Basic Vector Graphic Drawing See the video on youtube at this link:  Make Shop Pro - Vector Graphic Drawing There are three types of vector objects that can be created, these are Shapes, Lines, and Text.  For the purposes of this tutorial, we'll focus on shapes and lines. Shapes To draw a shape, simply click on the Vector Graphic tool which will be any of the icons below depending on what was selected last. Once the tool type is selected, you can simply drag on the image to draw the shape.   We'll discuss how to manipulate this shape below. Lines To draw a vector line, you'll need to first click on the Pen Tool In the Pen Tool menu (typically upper left), you'll see there are three types of lines you can draw:  Line, Bezier and Freehand.  Select which type you want to draw. Before attempting to draw, ensure that on your Materials palette that the Line material (upper left, shown as black) is not transparent or has a co...

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.

Video Editing with PaintShop Pro

Video Editing with PaintShop Pro View the youtube video on this entry here:  Video Effects in PaintShop Pro The general process of this technique is to use a video editor (I'm using Magix Vegas Pro ) to break up a video clip into individual images.  Then use batch processing with PaintShop Pro to apply an effect. Then chase that with an import in Vegas to recreate a video from the images. In this way we can create any script in PaintShop Pro, and apply it to a video clip in Magix Vegas. Rendering an Image Sequence In this phase, we are going to be working in the video editor (in my case Magix Vegas).  The first step is to drag the video clip (or clips) that you want to process into the timeline.  Once you have it arranged in the order you desire, go to File > Render As , and select Image Sequence as the Format , and choose which template you want to use, I'm going to use PNG.  Set the path, and note that this path will be filled with very many ...