This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > April 2007 > Question - promoting background layer
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]
| Author |
Question - promoting background layer
|
|
|
| Once again, as a script recorder much more than a scripter, I'm looking
for a shortcut. Sorry to be so wordy, but I figure an explanation of
why I'm looking for this will be the best way to make it easier for
others to understand and not guess at stuff.
This query arose from the Color Changer script, which just automates
creating the necessary layers and opening the adjustment dialogues for
colorizing within a selection. It works with no irritation if only
colorizing one object.
But to optimize workflow, those (like me) sometimes create one
selection and run the script, then another selection on the same image
to colorize that portion, etc, the idea being to first create all
necessary selections throughout the whole image with a rough basic
color chosen, and once all selections are done to go back at leisure
and then do the actual fine tuning on the various adjustment layers to
fine tune the blending and selected color for each object/selection.
Well, each new selection requires that it be done on the original
(lowermost) layer. And even though I know this well, I find myself
making my next selection and trying to run the script again only to
find that I forgot to first select that bottom layer after making the
selection (or before going on to make the next selection).
While a scripter would do this more elegantly, a recorder like me came
up with the idea of adding (to the script) a final command to create a
new layer, move it to the bottom, and then delete it. After deletion
the next layer would be selected (being the bottom layer).
Great, except it only works if the bottom layer is a regular layer and
not a background layer. So, bottom line, what is a simple way to
*start* any script that is to be run against the bottom layer and make
it promote a Background layer to a regular layer if needed, and to
ignore doing so if it is already a raster layer. With this info, I'd
make sure that the bottom layer was selected after each run of the
script so that I wouldn't have to think about going back to the
original layer before doing my next selection.
Thanks for any input!
Regards,
JoeB
| |
| SuzShook 2007-03-30, 11:19 pm |
| underprocessable | |
| Willy 2007-03-30, 11:19 pm |
| Add at end of ypur script
App.Do( Environment, 'SelectLayer',
{ 'Path': (9999,-9999, [], False ) } )
W
"JoeB" <mymail@myserver.com> wrote in message
news:Xns9903B6CD6C1CAJoeB@216.191.232.194...
> Once again, as a script recorder much more than a scripter, I'm looking
> for a shortcut. Sorry to be so wordy, but I figure an explanation of
> why I'm looking for this will be the best way to make it easier for
> others to understand and not guess at stuff.
>
> This query arose from the Color Changer script, which just automates
> creating the necessary layers and opening the adjustment dialogues for
> colorizing within a selection. It works with no irritation if only
> colorizing one object.
>
> But to optimize workflow, those (like me) sometimes create one
> selection and run the script, then another selection on the same image
> to colorize that portion, etc, the idea being to first create all
> necessary selections throughout the whole image with a rough basic
> color chosen, and once all selections are done to go back at leisure
> and then do the actual fine tuning on the various adjustment layers to
> fine tune the blending and selected color for each object/selection.
>
> Well, each new selection requires that it be done on the original
> (lowermost) layer. And even though I know this well, I find myself
> making my next selection and trying to run the script again only to
> find that I forgot to first select that bottom layer after making the
> selection (or before going on to make the next selection).
>
> While a scripter would do this more elegantly, a recorder like me came
> up with the idea of adding (to the script) a final command to create a
> new layer, move it to the bottom, and then delete it. After deletion
> the next layer would be selected (being the bottom layer).
>
> Great, except it only works if the bottom layer is a regular layer and
> not a background layer. So, bottom line, what is a simple way to
> *start* any script that is to be run against the bottom layer and make
> it promote a Background layer to a regular layer if needed, and to
> ignore doing so if it is already a raster layer. With this info, I'd
> make sure that the bottom layer was selected after each run of the
> script so that I wouldn't have to think about going back to the
> original layer before doing my next selection.
>
> Thanks for any input!
>
> Regards,
>
> JoeB
>
>
>
>
>
| |
|
| "SuzShook" <suzshook@adelphia.net> wrote in news:460c5788$1_1@cnews:
> What you probably want to do is check the bottom layer of the image,
> and if it's a background layer, promote it. You probably want to move
> to the bottom layer every time you rerun the script as well, don't you
> think, JoeB? Anyway, the attached snippet moves to the bottom layer,
> tests it to see if it's a background layer, and if so, promotes it.
> Hope it helps - let me know if you have any questions about it, JoeB.
> Suz
>
Thanks for the snippet, Suz. The first part actually achieves what I
want (going to the bottom layer) much better than my way of doing it
because it goes there whether it's a background or raster layer. In this
particular case, once I'm there it doesn't matter if it remains a
background layer. It only mattered because of the complicated way I was
trying to do it :-)
And yes, I do want to move to the bottom layer each time I run the script
so that I'm immediately on the correct layer to make the next selection.
When doing several selections on one image, it makes the workflow much
smoother to run the script in Silent mode and just select a rough color
for each one, and make all of the selections to be colorized first. Once
that is done I can then go back and do the color blending and tweaking on
all of them later.
Regards,
JoeB
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460c5ace_3@cnews:
> Add at end of ypur script
>
> App.Do( Environment, 'SelectLayer',
> { 'Path': (9999,-9999, [], False ) } )
>
> W
Thanks Willy. I'm curious why your snippet has 9999 as the first number
and Suz's has a zero. They both seem to work the same. I thought that
changing the False to True might do something different with both scripts
as a result but it just completes with an error, so that's not the
reason.
Regards,
JoeB
| |
|
|
"JoeB" <mymail@myserver.com> wrote in message
news:Xns99045EDC03CF9JoeB@216.191.232.194...
> "Willy" <willy@hotmail.com> wrote in news:460c5ace_3@cnews:
>
>
> Thanks Willy. I'm curious why your snippet has 9999 as the first number
> and Suz's has a zero. They both seem to work the same. I thought that
> changing the False to True might do something different with both scripts
> as a result but it just completes with an error, so that's not the
> reason.
>
> Regards,
>
> JoeB
JoeB nothing fancy.....
Just the way I have always done it, refers to how many levels you go out in
the layer hierarchy, and referenced in the document "Scripting for Script
Authors", Dated March 10, 2006, page 23. Also in previous version.
Just a copy paste operation...
W
| |
| SuzShook 2007-03-31, 7:22 pm |
| Your workflow might not be typical, JoeB - a user might make adjustments to
the Adjustment layers between iterations of the script. For that reason,
I'd put another SelectLayer step at the very top of the script - this would
ensure you are on the bottom layer before the script is re-run. Good idea?
Just have to copy the last step to the top of the script, if you decide to
do this. Then you're covered in all instances. Suz
JoeB wrote:
> "Willy" <willy@hotmail.com> wrote in news:460c5ace_3@cnews:
>
>
> Thanks Willy. I'm curious why your snippet has 9999 as the first
> number and Suz's has a zero. They both seem to work the same. I
> thought that changing the False to True might do something different
> with both scripts as a result but it just completes with an error, so
> that's not the reason.
>
> Regards,
>
> JoeB
| |
|
| Seems to me in order to use the selection tools you need to be on the bottom
layer to use them. I can't see a way, if you use one of the adjustment
layers, to get there without manually selecting that layer. Might work if
you use the manual selection tool to make the selections then run the script
..... selecting the bottom layer first.
W
"SuzShook" <suzshook@adelphia.net> wrote in message
news:460d3f0b$1_1@cnews...
> Your workflow might not be typical, JoeB - a user might make adjustments
> to the Adjustment layers between iterations of the script. For that
> reason, I'd put another SelectLayer step at the very top of the script -
> this would ensure you are on the bottom layer before the script is re-run.
> Good idea? Just have to copy the last step to the top of the script, if
> you decide to do this. Then you're covered in all instances. Suz
>
> JoeB wrote:
>
>
| |
| SuzShook 2007-03-31, 7:22 pm |
| I fooled around using the Freehand Selection tool, Willy, and I can make a
selection using that tool no matter which layer is active. I "saw" the
image layer (bottom layer) and "thought" I was on that layer, when in fact,
I was on the top layer of the image. When I tried to rerun the script, not
realizing the bottom layer was not active, I ended up with a black and white
palette, which was not what I wanted. Even with a "return to bottom layer"
step at the end of the script, if a user works with the adjustment layers
before rerunning the script, the same situation can occur - you could have
the wrong layer active. That's why I suggested that the script should
always ensure the bottom layer is active at the start. Suz
Willy wrote:[color=darkred]
> Seems to me in order to use the selection tools you need to be on the
> bottom layer to use them. I can't see a way, if you use one of the
> adjustment layers, to get there without manually selecting that
> layer. Might work if you use the manual selection tool to make the
> selections then run the script .... selecting the bottom layer first.
> W
>
> "SuzShook" <suzshook@adelphia.net> wrote in message
> news:460d3f0b$1_1@cnews...
| |
|
| That is correct Suz, If you stick with the freehand selection tool and have
the go Select layer go to the bottom layer at the start of the script all
works well. I haven't found a way to use any of the other selection tools
unless your already on the bottom layer. After using one of the adjustment
layers the only way I find I can get there is manually.
W
"SuzShook" <suzshook@adelphia.net> wrote in message
news:460d4df6$1_3@cnews...
>I fooled around using the Freehand Selection tool, Willy, and I can make a
>selection using that tool no matter which layer is active. I "saw" the
>image layer (bottom layer) and "thought" I was on that layer, when in fact,
>I was on the top layer of the image. When I tried to rerun the script, not
>realizing the bottom layer was not active, I ended up with a black and
>white palette, which was not what I wanted. Even with a "return to bottom
>layer" step at the end of the script, if a user works with the adjustment
>layers before rerunning the script, the same situation can occur - you
>could have the wrong layer active. That's why I suggested that the script
>should always ensure the bottom layer is active at the start. Suz
>
> Willy wrote:
>
>
| |
|
| "SuzShook" <suzshook@adelphia.net> wrote in news:460d4df6$1_3@cnews:
> I fooled around using the Freehand Selection tool, Willy, and I can
> make a selection using that tool no matter which layer is active. I
> "saw" the image layer (bottom layer) and "thought" I was on that
> layer, when in fact, I was on the top layer of the image. When I
> tried to rerun the script, not realizing the bottom layer was not
> active, I ended up with a black and white palette, which was not what
> I wanted. Even with a "return to bottom layer" step at the end of
the
> script, if a user works with the adjustment layers before rerunning
> the script, the same situation can occur - you could have the wrong
> layer active. That's why I suggested that the script should always
> ensure the bottom layer is active at the start. Suz
That is exactly the reason I requested help in how to get to the bottom
layer automatically. Even with my workflow what was happening is that
I'd run the script and the HSL layer would be the last selected layer.
Not thinking about it, I'd do my second selection and run the script
and, as you discovered, you get the greyscale palette because the
selection is on the adjustment layer, meaning I'd have to cancel out of
the script and then select the bottom layer.
And yes, your suggestion about also having the code at the start of the
script is a good one, and I have implemented it. It should always
start at the bottom layer regardless of workflow. Having that
greyscale palette show up cofused me the first time it happened when I
was testing the script!
Regards,
JoeB
> Willy wrote:
the[color=darkred]
first.[color=darkred]
>
>
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460d381c$1_1@cnews:
>
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns99045EDC03CF9JoeB@216.191.232.194...
so[color=darkred]
> JoeB nothing fancy.....
> Just the way I have always done it, refers to how many levels you go
> out in the layer hierarchy, and referenced in the document "Scripting
> for Script Authors", Dated March 10, 2006, page 23. Also in previous
> version. Just a copy paste operation...
> W
>
Thanks, I found it in the pdf. Now how do I find the 2006 version?
Mine is the 2004 version, downloaded from the Jasc resources page. I
couldn't find another version on the Corel page by typing the title
into the search box.
Regards,
JoeB
| |
| SuzShook 2007-03-31, 7:23 pm |
| I just tried the Selection tool, and it works, too. Suz
Willy wrote:[color=darkred]
> That is correct Suz, If you stick with the freehand selection tool
> and have the go Select layer go to the bottom layer at the start of
> the script all works well. I haven't found a way to use any of the
> other selection tools unless your already on the bottom layer. After
> using one of the adjustment layers the only way I find I can get
> there is manually.
> W
>
>
> "SuzShook" <suzshook@adelphia.net> wrote in message
> news:460d4df6$1_3@cnews...
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460d5222_2@cnews:
> That is correct Suz, If you stick with the freehand selection tool
and
> have the go Select layer go to the bottom layer at the start of the
> script all works well. I haven't found a way to use any of the other
> selection tools unless your already on the bottom layer. After using
> one of the adjustment layers the only way I find I can get there is
> manually.
>
> W
Yes, you have to use one of the manual selection tools (rectangle,
circle, etc). The initial issue arises because the bottom (original)
layer is always visible so it's easy think that, when you select your
next object, that you are making the selection on that layer when, in
fact, you're not, so if you make an HSL adjustment, then make another
selection to colorize, if the script doesn't automatically shoot you
back to the bottom you'll have to cancel out and select manually.
Of course, you can't make your selection using a tool like magic wand
if you're not on the correct layer to start with. But if you just run
the script with one selection and then want to make another (without
having gone to any of the other layers, you'll be on the bottom layer
so could use the magic wand. And most selections for colorizing parts
of an image will be done with the freehand tool I suspect.
Regards,
JoeB
> "SuzShook" <suzshook@adelphia.net> wrote in message
> news:460d4df6$1_3@cnews...
the[color=darkred]
the[color=darkred]
Then[color=darkred]
with[color=darkred]
>
>
>
| |
|
| I have it at the beginning and end of the script. That way if no adjustments
are made I can jump in and do a selection using any selection method I want.
ie magic wand
W
"JoeB" <mymail@myserver.com> wrote in message
news:Xns99047BE2E4291JoeB@216.191.232.194...
> "SuzShook" <suzshook@adelphia.net> wrote in news:460d4df6$1_3@cnews:
>
> the
>
> That is exactly the reason I requested help in how to get to the bottom
> layer automatically. Even with my workflow what was happening is that
> I'd run the script and the HSL layer would be the last selected layer.
> Not thinking about it, I'd do my second selection and run the script
> and, as you discovered, you get the greyscale palette because the
> selection is on the adjustment layer, meaning I'd have to cancel out of
> the script and then select the bottom layer.
>
> And yes, your suggestion about also having the code at the start of the
> script is a good one, and I have implemented it. It should always
> start at the bottom layer regardless of workflow. Having that
> greyscale palette show up cofused me the first time it happened when I
> was testing the script!
>
> Regards,
>
> JoeB
>
>
> the
> first.
>
| |
|
|
"JoeB" <mymail@myserver.com> wrote in message
news:Xns99047C39B73B0JoeB@216.191.232.194...
> "Willy" <willy@hotmail.com> wrote in news:460d381c$1_1@cnews:
>
> so
>
> Thanks, I found it in the pdf. Now how do I find the 2006 version?
> Mine is the 2004 version, downloaded from the Jasc resources page. I
> couldn't find another version on the Corel page by typing the title
> into the search box.
>
> Regards,
>
> JoeB
JoeB try here
ftp://ftp.corel.com/pub/documentation/PSP/
file name is PSP Scripting For Script Authors.zip and the file inside is
the Scripting How To.pdf which is the Paint Shop Pro X, Scripting for Script
Authors, Revision 7, March 10, 2006.
Bouncing around the layers gets complicated for me real fast.........
HTH.
W
| |
|
|
"Willy" <willy@hotmail.com> wrote in message news:460d9508$1_3@cnews...
>
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns99047C39B73B0JoeB@216.191.232.194...
>
> JoeB try here
> ftp://ftp.corel.com/pub/documentation/PSP/
> file name is PSP Scripting For Script Authors.zip and the file inside is
> the Scripting How To.pdf which is the Paint Shop Pro X, Scripting for
> Script Authors, Revision 7, March 10, 2006.
> Bouncing around the layers gets complicated for me real fast.........
> HTH.
> W
The PSP XI Command API is also on that page.
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460d9508$1_3@cnews:
>
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns99047C39B73B0JoeB@216.191.232.194...
go[color=darkred]
I[color=darkred]
>
> JoeB try here
> ftp://ftp.corel.com/pub/documentation/PSP/
> file name is PSP Scripting For Script Authors.zip and the file
inside
> is the Scripting How To.pdf which is the Paint Shop Pro X, Scripting
> for Script Authors, Revision 7, March 10, 2006.
Thanks Willy. I snagged the updated version.
> Bouncing around the layers gets complicated for me real fast.........
Not quite sure what you mean by this??
Regards,
JoeB
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460d95cd_3@cnews:
>
> "Willy" <willy@hotmail.com> wrote in message
> news:460d9508$1_3@cnews...
with[color=darkred]
Also[color=darkred]
fast.........[color=darkred]
>
> The PSP XI Command API is also on that page.
Thanks again, and I've downloaded it also. I will admit, however, that
while I can follow the v.9 Scripting stuff reasonably well (but haven't
really learned much yet) I don't have a clue what's happening with the
API, so only downloaded the v.XI one in case I ever learn :-)
Regards,
JoeB
| |
|
|
"JoeB" <mymail@myserver.com> wrote in message
news:Xns9904BD91CAAA3JoeB@216.191.232.194...
> "Willy" <willy@hotmail.com> wrote in news:460d9508$1_3@cnews:
>
> go
> I
> inside
>
> Thanks Willy. I snagged the updated version.
>
>
>
>
> Not quite sure what you mean by this??
>
> Regards,
>
> JoeB
>
Navigating the layers as in the Chart on page 22 of the Scripting for Script
Authors, Revision 7, March 10, 2006.
W
| |
|
| "Willy" <willy@hotmail.com> wrote in news:460e14a1$1_3@cnews:
>
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns9904BD91CAAA3JoeB@216.191.232.194...
first[color=darkred]
I[color=darkred]
version?[color=darkred]
title[color=darkred]
Scripting[color=darkred]
> Navigating the layers as in the Chart on page 22 of the Scripting for
> Script Authors, Revision 7, March 10, 2006.
> W
Yes, I know what you mean. I read through that myself and it
definitely can cause a headache!
Regards,
JoeB
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|