This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > January 2007 > PING Suz - My post to Willy - Combine RGB





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 PING Suz - My post to Willy - Combine RGB
JoeB

2007-01-27, 11:39 pm

JoeB

2007-01-27, 11:39 pm

JoeB <mymail@myserver.com> wrote in
news:Xns98C2D21EA55DAJoeB@216.191.232.194:

> Hi Suz,
>
> With all the discussion between myself, Willy, and you and especially
> with you providing a script that worked, I think I figured out a way
> to make things work in v.XI with just having a script that splits the
> image (based on stuff I learned from the script you posted).
>
> So here's the text of the message I posted to Willy.
>



I forgot to include the text, so it should appear now between the
asterisks!

**************************************************

I would stress that the attached scripts were done based on all of the
discussion between you, me and Suz, as well as Suz' last posted script,
and my finally realizing that the problem in the v.XI Combine from RGB
is because the split greyscale images don't have file names, just layer
info.

I am attaching 3 scripts. The important one is the first one, named
XI-split_to_RGB.pspscript.

The concept is that the problem in v.XI doesn't really have problems
recombining from RGB, it's that people don't know what they're combining
because nothing shows up in the channel boxes of the Combine from RGB
dialogue.

So here's the way this should work.

Download the scripts. Put all of them in your Scripts>Trusted folder.

What the scripts do is split to RGB any open image you have selected,
and it doesn't matter how many images you might have open when you
decide to select one to split.

Each script works the same, but the _01 and -02 scripts just add that
extension to the file name in the dialoge boxes when you get to the
stage of Combining from RGB.

The first script (XI-split_to_RGB.pspscript) will actually provide file
names to each of the split greyscale images. They do this by saving
each image as a bmp in the Windows/temp folder, which then actually
provides a file name for each greyscale image (Red.bmp, Green.bmp, and
Blue.bmp). This file name can now be read by the v.XI Combine from RGB
dialogues. Now you should be able to do what you want with each
greyscale channel image and not have to worry about which one is in
focus when you want to Combine from RGB.

When you're ready to combine, just use the regular Image>Combine from
RGB from the Image menu item. Now you should see those names in the R,
G, and B boxes. You can combine as you like, selecting which channel
you want from each of the R, G, and B channel dropdowns.

What's even better, there are two more attached scripts, one named XI-
split_to_RGB_01.pspscript and the other XI-split_to_RGB_02.pspscript.

If you have another open image (along with the first one you split) you
can use the XI-split_to_RGB_01 pspscript script and split that image
into channels, and they will be named Red_1,bmp, Blue_1.bmp and Green_
1.bmp. If you kept your first splits open, now when you go to Image>
Combine from RGB you'll be able to use the dropdown boxes and select
from the Red.bmp or Red-O1.bmp, and the same with Blue and Green.

Actually, you can just use the first script on all open images, except
that in the Combine dialogue box they'll all show up as sucessive
Red.bmp, Green.bmp and Blue.bmp names, without the sequence numbers
after them. The additional two scripts just make it easier to see the
sequence in which you created the splits.

Of course, they can be bound to an icon and placed in your Image menu so
that you can use them to Split to RGB instead of the default item
provided. You just use the default Combine from RGB when you're ready
to do so.

**************************************8


> I'm also attaching the scripts I sent in my post to Willy..
>
> Hope you don't mind that I worked off of what I learned from you, but
> I don't know enough to do it myself! :-)
>
> Now that I've taken it this far (and assuming it works in v.XI), I
> don't think the layers need renaming but didn't have the energy to
> clean the stuff up, so this is what I've come up with to date.
> Hopefully Willy will test it in v.XI and post back with his results.
>
> Regards,
>
> JoeB
> Attachment decoded: untitled-2.txt
> --==_=_====____39106.86064868061116BE8E==
> Attachment decoded: XI_split_to_RGB_2.PspScript
> --==_=_====____39106.86064868061116BE8E==
> Attachment decoded: XI_split_to_RGB.PspScript
> --==_=_====____39106.86064868061116BE8E==
> Attachment decoded: XI_split_to_RGB_1.PspScript
> --==_=_====____39106.86064868061116BE8E==--


SuzShook

2007-01-27, 11:39 pm

Hi, Joe and Willy,

Have been MIA for about a day - the "real world" intervenes again! Have
just finished reading all your posts, and testing all the scripts.
Strangely enough, I was not fully aware of the problem in PSP XI, as I had
not yet applied the patch. I just did that (applied the patch), and now see
that my original script won't work, as there is no name assigned to the
channel images. So no name is written to the Script Output palette, and
hence, one does not really know which image is the "blue" image.

Joe, your scripts work perfectly. If a user who wants to split images to
the R, G, and B channels uses your scripts to do those splits, recombining
using the Image..Combine Channel...Combine from RGB is entirely possible,
and easy to accomplish! Good job, Joe! It't the splitting that's the
problem, as no names are assigned, and your scripts take care of that.
You've given us 3 scripts, which allows up to 3 different splits. By
altering any one of those scripts, an infinite number of splits can be made,
if one is so inclined. Then, the Combine from RGB dialog can be used to
combine any combination of those splits. I like it. I don't use this
facility in any of my work, but I can see that this takes care of the
problem until Corel comes up with another patch

I don't think your approach will work consistently, Willy. It does the
combine, but if one has more than the original three splits in the
workspace, it does several combines. I think Joe's approach is more
practical, for all cases.

Again, sorry I didn't respond sooner - just wasn't here! Suz

JoeB wrote:
> Hi Suz,
>
> With all the discussion between myself, Willy, and you and especially
> with you providing a script that worked, I think I figured out a way
> to make things work in v.XI with just having a script that splits the
> image (based on stuff I learned from the script you posted).
>
> So here's the text of the message I posted to Willy.
>
> I'm also attaching the scripts I sent in my post to Willy..
>
> Hope you don't mind that I worked off of what I learned from you, but
> I don't know enough to do it myself! :-)
>
> Now that I've taken it this far (and assuming it works in v.XI), I
> don't think the layers need renaming but didn't have the energy to
> clean the stuff up, so this is what I've come up with to date.
> Hopefully Willy will test it in v.XI and post back with his results.
>
> Regards,
>
> JoeB



JoeB

2007-01-27, 11:39 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45b8d26f$1_1@cnews:

> Hi, Joe and Willy,
>
> Have been MIA for about a day - the "real world" intervenes again!
> Have just finished reading all your posts, and testing all the
> scripts. Strangely enough, I was not fully aware of the problem in PSP
> XI, as I had not yet applied the patch. I just did that (applied the
> patch), and now see that my original script won't work, as there is no
> name assigned to the channel images. So no name is written to the
> Script Output palette, and hence, one does not really know which image
> is the "blue" image.
>
> Joe, your scripts work perfectly. If a user who wants to split images
> to the R, G, and B channels uses your scripts to do those splits,
> recombining using the Image..Combine Channel...Combine from RGB is
> entirely possible, and easy to accomplish! Good job, Joe! It't the
> splitting that's the problem, as no names are assigned, and your
> scripts take care of that. You've given us 3 scripts, which allows up
> to 3 different splits. By altering any one of those scripts, an
> infinite number of splits can be made, if one is so inclined. Then,
> the Combine from RGB dialog can be used to combine any combination of
> those splits. I like it. I don't use this facility in any of my
> work, but I can see that this takes care of the problem until Corel
> comes up with another patch
>
> I don't think your approach will work consistently, Willy. It does
> the combine, but if one has more than the original three splits in the
> workspace, it does several combines. I think Joe's approach is more
> practical, for all cases.
>
> Again, sorry I didn't respond sooner - just wasn't here! Suz
>


No problem - real life comes first!

I'm glad the scripts work as planned. There is one glitch, however,
that Willy noticed and that is they only work if people have a
Windows/Temp folder. He was able to edit the script for his needs
because he has a Winnt/temp folder. If the script could create a C:
\pspsplittemp folder that would work, except perhaps some people's anti-
virus might intervene, I don't know. He also suggested that the script
delete the saved files but I don't think that's practical because I
don't think Windows will allow them to be deleted when they're being
used by another program. Besides, I think the script just overwrites
previous bmp files so you'll never have a whole bunch of them. If the
most simultaneous splits you would do is five, for example, you'd have
15 bmps and that's not a lot of HD space.

Regards,

JoeB



> JoeB wrote:
>
>
>


Willy

2007-01-27, 11:39 pm


"SuzShook" <suzshook@adelphia.net> wrote in message
news:45b8d26f$1_1@cnews...
> Hi, Joe and Willy,
>
> Have been MIA for about a day - the "real world" intervenes again! Have
> just finished reading all your posts, and testing all the scripts.
> Strangely enough, I was not fully aware of the problem in PSP XI, as I had
> not yet applied the patch. I just did that (applied the patch), and now
> see that my original script won't work, as there is no name assigned to
> the channel images. So no name is written to the Script Output palette,
> and hence, one does not really know which image is the "blue" image.
>
> Joe, your scripts work perfectly. If a user who wants to split images to
> the R, G, and B channels uses your scripts to do those splits, recombining
> using the Image..Combine Channel...Combine from RGB is entirely possible,
> and easy to accomplish! Good job, Joe! It't the splitting that's the
> problem, as no names are assigned, and your scripts take care of that.
> You've given us 3 scripts, which allows up to 3 different splits. By
> altering any one of those scripts, an infinite number of splits can be
> made, if one is so inclined. Then, the Combine from RGB dialog can be
> used to combine any combination of those splits. I like it. I don't use
> this facility in any of my work, but I can see that this takes care of the
> problem until Corel comes up with another patch
>
> I don't think your approach will work consistently, Willy. It does the
> combine, but if one has more than the original three splits in the
> workspace, it does several combines. I think Joe's approach is more
> practical, for all cases.
>
> Again, sorry I didn't respond sooner - just wasn't here! Suz
>
> JoeB wrote:
>
>

Your Right Suz, it was a great learning experience. I also think Joe's
scripts are the way to go since you can set the combine to use the files you
want. I did add a os.remove and deleted the files just after they were
created. I used the temp folder once I noticed the path was different than
Joe's and made the change.
Great work Joe.
W


Willy

2007-01-27, 11:39 pm


Joe, here is the small mod I did to get rid of the files.

from JascApp import *
import os



# FileSaveAs
App.Do( Environment, 'FileSaveAs', {
'Encoding': {
'BMP': {
'Compressed': False,
'Format': App.Constants.BmpFormat.Windows
}
},
'FileName': u'C:\\WINNT\\Temp\\Blue.bmp',
'FileFormat': App.Constants.FileFormat.BMP,
'FormatDesc': u'BMP Windows or OS/2 Bitmap',
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.AllAlways,
'Version': ((9,0,1),1)
},
'DefaultProperties': []
})

os.remove('C:\\WINNT\\Temp\\Blue.bmp')
Did this for each one as it was made. Didn't make any difference on the
combine.
Again a good script.
W


JoeB

2007-01-27, 11:39 pm

"Willy" <willy@hotmail.com> wrote in news:45b8d976$1_2@cnews:

>
> Joe, here is the small mod I did to get rid of the files.
>
> from JascApp import *
> import os
>
>
>
> # FileSaveAs
> App.Do( Environment, 'FileSaveAs', {
> 'Encoding': {
> 'BMP': {
> 'Compressed': False,
> 'Format': App.Constants.BmpFormat.Windows
> }
> },
> 'FileName': u'C:\\WINNT\\Temp\\Blue.bmp',
> 'FileFormat': App.Constants.FileFormat.BMP,
> 'FormatDesc': u'BMP Windows or OS/2 Bitmap',
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode':

App.Constants.AutoActionMode.AllAlways,
> 'Version': ((9,0,1),1)
> },
> 'DefaultProperties': []
> })
>
> os.remove('C:\\WINNT\\Temp\\Blue.bmp')
> Did this for each one as it was made. Didn't make any difference on

the
> combine.
> Again a good script.
> W
>


Thanks Willy, but you may know by now that Suz already posted the
modification, and I've added it to 3 scripts, zipped the scripts and
posted in a new thread pinging you and Suz. Glad you like the script!

Regards,

JoeB
Spandex Rutabaga

2007-01-27, 11:39 pm

Willy wrote:

> # FileSaveAs
> App.Do( Environment, 'FileSaveAs', {
> 'Encoding': {
> 'BMP': {
> 'Compressed': False,


As a matter of principle it might be better to save in paletted
PNG format with few colors to keep the size of the saved file
down (even if it is junked later). As I understand it the file
is not actually used so its contents don't matter. The save is
just done to create a document name.
Willy

2007-01-27, 11:39 pm

I would think .jpg at highest compression, just to get a name.
W
"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:45B94864.DD9BF94D@agabatur.xednaps...
> Willy wrote:
>
>
> As a matter of principle it might be better to save in paletted
> PNG format with few colors to keep the size of the saved file
> down (even if it is junked later). As I understand it the file
> is not actually used so its contents don't matter. The save is
> just done to create a document name.



Spandex Rutabaga

2007-01-27, 11:39 pm

Willy wrote:
>
> I would think .jpg at highest compression, just to get a name.


I agree, but this could end up changing people's JPEG compression
settings. Nasty for those who don't know much about the dangers
of JPEG. Those people probably don't resort to PNG very much and
use the PNG Optimizer if they do :)
Willy

2007-01-27, 11:39 pm

Your probably correct. I have one that uses jpg and the file size is around
2710. I don't see any difference in the quality of the combine. I can't get
the rename to show in the combine using the png file type.
W

"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:45B95729.E37DF12C@agabatur.xednaps...
> Willy wrote:
>
> I agree, but this could end up changing people's JPEG compression
> settings. Nasty for those who don't know much about the dangers
> of JPEG. Those people probably don't resort to PNG very much and
> use the PNG Optimizer if they do :)



SuzShook

2007-01-27, 11:39 pm

Spandex Rutabaga wrote:
> Willy wrote:
>
>
> As a matter of principle it might be better to save in paletted
> PNG format with few colors to keep the size of the saved file
> down (even if it is junked later). As I understand it the file
> is not actually used so its contents don't matter. The save is
> just done to create a document name.


I tested and the JPG file with compression factor of 99 was smaller even
than the PNG, so I went with that. Thanks for the suggestion, though,
Spandex. Suz


JoeB

2007-01-27, 11:39 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45b9657f$1_1@cnews:

> Spandex Rutabaga wrote:
>
> I tested and the JPG file with compression factor of 99 was smaller even
> than the PNG, so I went with that. Thanks for the suggestion, though,
> Spandex. Suz
>


Suz, I think you have to go back to another file format, as SR suggested in
another thread. The reason I chose BMP format was that I didn't expect the
options for that format would change things significantly for most users.
Using the jpg format causes the Save options dialogue to change to a
compression factor of 99, and as SR pointed out many people don't even know
about this compression stuff and at least the default when they install PSP
doesn't do serious damage the first save or two.

I don't think file size for these temporary saves is an issue, because the
files get deleted immediately.

Regards,

JoeB
JoeB

2007-01-27, 11:39 pm

Spandex Rutabaga <SpRu@agabatur.xednaps> wrote in
news:45B95729.E37DF12C@agabatur.xednaps:

> Willy wrote:
>
> I agree, but this could end up changing people's JPEG compression
> settings. Nasty for those who don't know much about the dangers
> of JPEG. Those people probably don't resort to PNG very much and
> use the PNG Optimizer if they do :)
>


I agree, and the settings in the Save options change as you suspected they
would. I think that any format that is lossless and won't materially
effect any image saved by a person using just "Save" (which is a terrible
option to use but we're talking about people with not much experience with
this stuff) is a good format to use. File size of the saves is not a real
issue as the images are deleted once the script is run.

I posted my opinion, based on your opinion, to Suz in the other thread.

Regards,

JoeB
JoeB

2007-01-27, 11:39 pm

"Willy" <willy@hotmail.com> wrote in news:45b95c14$1_2@cnews:

> Your probably correct. I have one that uses jpg and the file size is
> around 2710. I don't see any difference in the quality of the combine.
> I can't get the rename to show in the combine using the png file
> type. W
>


I haven't tried with png, but I chose bmp when I first tried this issue
simply because it's a standard format. I don't think file size of these
saves should matter because the files get deleted as soon as the
greyscale images are named. Sticking to a common file format like bmp
will do the job and not change people's settings in any way that may be
destructive when they use their Save menu item.

Regards,

JoeB






> "Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
> news:45B95729.E37DF12C@agabatur.xednaps...
>
>
>


Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews