This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > November 2007 > Duotone in PSP
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Big Bad Dave 2007-11-04, 3:16 am |
| I was recently reading an article about duotone and tritone effects in PS
and was wondering if there is a way of achieving something similar in PSP. I
couldn't think of one, but I'm happy to be proved wrong.
It occured to me that a good way of doing it would be to use a multipoint
blend material as a lookup table through which a greyscale image can be
passed. I couldn't be bothered to try to fathom out the excentricites of
the PS plugin interface, so I've written a script and a little applet that
do the following:
- Pop up the material select dialog to allow you to choose the blend to be
used as the lookup table.
- Saves the current image (merged) to a temporary file in 24 bit windows
bitmap format (the simplest file format that I know).
- Creates a 256 by 1 pixel temporary image and flood-fills it with the
selected blend material.
- Saves the blend image in windows bitmap format then closes it.
- Runs a little application that I wrote in 'C' which reads the image and
blend bitmap files, processes the image through the blend lookup table and
write out the processed image file.
- The script then opens the processed image file, selects everything, copies
it to the clipboard, and closes it.
- It then returns to the original image and pastes the processed image in as
a new layer.
- Finally, the script deletes the three temporary files from disk.
A little contrived, I'll grant you, but it does work. I've attached the
script (which has to go in Scripts-Trusted) and the application executable
(renamed as .XXX. Change to .exe). The application was compiled as a
console app using MS Visual Studio 8. I've also included the source code
for the applet, in case you don't trust me and want to compile it yourself.
The script assumes that the applet will also be in Scripts-Trusted. If you
put it somewhere else, change the "AppDir" variable to where you put it.
You can also change the folder used for temporary files by changing
"TempDir", which defaults to C:\TEMP
The "Duotone Brown" blend gives quite a nice sepia effect.
One slight annoyance is that if you click "Cancel" on the material dialog
box, the script doesn't stop. Does anyone know if there's a way of checking
the return state of a dialog before proceeding.
Enjoy!
Dave
| |
| Big Bad Dave 2007-11-04, 3:16 am |
| underprocessable | |
| Big Bad Dave 2007-11-04, 3:16 am |
|
"Big Bad Dave" <dave@hotmail.com> wrote in message news:472d7826_1@cnews...
> "Big Bad Dave" <dave@hotmail.com> wrote in message
> news:472d77d6_2@cnews...
> Ooops, sorry. I forgot to attach the bits...
>
>
>
I think having the ability to remap the pixels using a blend would be
another good thing to be able to create as an adjustment layer (along with a
"histogram adjust" adjustment layer). They are both just simple 256 entry
RGB lookup tables. Any other things people would like to see in adjustment
layers?
Dave
| |
| Big Bad Dave 2007-11-04, 6:15 am |
|
"Big Bad Dave" <dave@hotmail.com> wrote in message news:472d7c89_1@cnews...
>
> "Big Bad Dave" <dave@hotmail.com> wrote in message
> news:472d7826_1@cnews...
>
> I think having the ability to remap the pixels using a blend would be
> another good thing to be able to create as an adjustment layer (along with
> a "histogram adjust" adjustment layer). They are both just simple 256
> entry RGB lookup tables. Any other things people would like to see in
> adjustment layers?
>
> Dave
>
>
Oh yes. I forgot to say. To get the best effect from this method, it's
best to convert the image to greyscale before running the script. This is
because the applet uses a simple (R+G+B)/3 method of converting to an 8 bit
lookup table index, which is unlikely to give you the best range of
contrast. I tend to use a channel-mixer adjustment layer in monochrome
mode, over the top of the image.
Dave
| |
| Spandex Rutabaga 2007-11-04, 6:18 pm |
| Big Bad Dave wrote:
>
> I was recently reading an article about duotone and tritone effects in PS
> and was wondering if there is a way of achieving something similar in PSP. I
> couldn't think of one, but I'm happy to be proved wrong.
>
> It occured to me that a good way of doing it would be to use a multipoint
> blend material as a lookup table through which a greyscale image can be
> passed.
Have you perhaps discovered gradient mapping, where each successive
grey level of an image is associated with a successive color along
a gradient? Here's a gradient mapping script by Gary Barton:
http://pixelnook.home.comcast.net/TheLab.html
The same simple recipe is behind a number of the newer PSP effects.
Since the gradient can be anything you like the effect is quite
flexible. The result can be something like a sepia tone or duotone
but if you choose dark colors for the end of the gradient that
maps to light grey (or the converse) the result can be quite exotic
too. With multiple repeats on the gradient you can get effects
resembling shiny metals. By blurring the image before gradient
mapping you can get "glow" effects.
Adjusting the gamma of the image will change how much of each
gradient color appears in the image. When the greyscale distribution
of the image is very uneven running Histogram Equalize before
gradient mapping can be useful. (Often it is most effective to
do that on a duplicate layer, set the result layer opacity to 50%
and merge down.) When the gradient has a lot of abrupt color
variation noise can become apparent in the gradient mapped image.
A little EPS, DCNR or Gaussian Blur before mapping can help in
this case. Gary's script will greyscale the image before mapping
the gradient onto it using the PSP Greyscale command (which since
PSP 9 is perceptual). However, there is nothing to prevent you
starting with a greyscale image cooked up with the Channel Mixer
filter or the variations on it in newer PSP versions. You could
also use channel splitting (Image > Split Channel) or first run
a plug-in such as Virtual Photographer from Optik Verve Labs.
Some examples of gradient mapping are in the attached image.
Related to gradient mapping is a more ambitious task, namely taking
colors from one image and "applying" them to another image. This is
a little hard to explain and is probably best seen with examples.
An Image Repainter plug-in for this is available from ImageSkill -
see http://www.imageskill.com/imagerepa...erepainter.html
The page has some explanatory examples. I think this kind of color
transfer is pretty slick and the price of the plug-in is unusually
reasonable.
| |
| Big Bad Dave 2007-11-04, 6:18 pm |
|
"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:472DF55A.AC40F35F@agabatur.xednaps...
> Big Bad Dave wrote:
>
> Have you perhaps discovered gradient mapping, where each successive
> grey level of an image is associated with a successive color along
> a gradient? Here's a gradient mapping script by Gary Barton:
> http://pixelnook.home.comcast.net/TheLab.html
> The same simple recipe is behind a number of the newer PSP effects.
>
> Since the gradient can be anything you like the effect is quite
> flexible. The result can be something like a sepia tone or duotone
> but if you choose dark colors for the end of the gradient that
> maps to light grey (or the converse) the result can be quite exotic
> too. With multiple repeats on the gradient you can get effects
> resembling shiny metals. By blurring the image before gradient
> mapping you can get "glow" effects.
>
> Adjusting the gamma of the image will change how much of each
> gradient color appears in the image. When the greyscale distribution
> of the image is very uneven running Histogram Equalize before
> gradient mapping can be useful. (Often it is most effective to
> do that on a duplicate layer, set the result layer opacity to 50%
> and merge down.) When the gradient has a lot of abrupt color
> variation noise can become apparent in the gradient mapped image.
> A little EPS, DCNR or Gaussian Blur before mapping can help in
> this case. Gary's script will greyscale the image before mapping
> the gradient onto it using the PSP Greyscale command (which since
> PSP 9 is perceptual). However, there is nothing to prevent you
> starting with a greyscale image cooked up with the Channel Mixer
> filter or the variations on it in newer PSP versions. You could
> also use channel splitting (Image > Split Channel) or first run
> a plug-in such as Virtual Photographer from Optik Verve Labs.
>
> Some examples of gradient mapping are in the attached image.
>
> Related to gradient mapping is a more ambitious task, namely taking
> colors from one image and "applying" them to another image. This is
> a little hard to explain and is probably best seen with examples.
> An Image Repainter plug-in for this is available from ImageSkill -
> see http://www.imageskill.com/imagerepa...erepainter.html
> The page has some explanatory examples. I think this kind of color
> transfer is pretty slick and the price of the plug-in is unusually
> reasonable.
Oh I see. Thanks Spandex. After I started this thread this morning, it did
occur to me to use the palette of an 8 bit windows bitmap file, but I was
still thinking about doing it with an external program. I didn't think of
manipulating the palette in the script directly. Is that what they call
"thinking outside the box" ;-)
Dave
| |
| Spandex Rutabaga 2007-11-04, 6:18 pm |
| Big Bad Dave wrote:
> Oh I see. Thanks Spandex. After I started this thread this morning, it did
> occur to me to use the palette of an 8 bit windows bitmap file, but I was
> still thinking about doing it with an external program.
In place of a BMP file you might want to consider the Portable
Pixelmap format (PPM). A nice simple human readable format
(though it has a binary variant too, which is more compact).
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|