This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > June 2007 > Tapestry Script - Updated





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 Tapestry Script - Updated
Spandex Rutabaga

2007-05-23, 6:19 pm

The attached contains a reworked version of the Tapestry Script
created by Peter Anderson and posted by Rusty. It contains a
number of changes.

The principle of the script is to apply a 10 x 10 pixel texture
overlay to the image. There are some color simplification steps
and tweaks to the steps to mimic the limited number of thread
colors available in embroidery.

I've tried to fix various issues:

1. The script no longer uses an auxiliary image. The required
image is embedded in the script so all you need is the script.
2. The script involved a recorded Resize step which wouldn't
work correctly for arbitrary images. The script now defaults
to resizing the larger of width and height to 900 pixels,
which gives you 90 stitches along the larger dimension. If
you are running the script interactively the default new
size can be changed. I don't recommend making it much smaller
than 900 pixels. If you need a smaller image you will get
better results by running at a 900-pixel major dimension and
then resizing the final image smaller, optionally followed
by a sharpening step.
3. The script requires an increase in color depth. This is now
done instead of relying on the PSP Autoaction to do it.
4. Steps have been reorganized to minimize redundancy.
5. The Pixelation and Gaussian Blur steps have been switched
to Silent since they are matched to the size of the texture
image and there is little point to changing them.
6. The coordinate for the Fill step has been changed to work
with any size image.
7. All steps except the resize and the color reduction are now
silent to minimize distractions. The script can be edited in
Notepad to change App.Constants.ExecutionMode.Silent to
App.Constants.ExecutionMode.Default if you wish. (Save with
a new name just in case :)
8. Some changes were made to the code so it will run in versions
of PSP from PSP 8 to PSPP XI and the script should also not be
sensitive to the language variant of PSP. ("Should" means "I
haven't tested it" :)

Warnings:
1. The Fill step may not work correctly if the image contains a
selection. A solution is to save the selection to the alpha
channel, deselect and run the script on a duplicate image
without the selection. Later the processed duplicate image
can be pasted back as a new layer into the original using
Copy Merged. Then the selection can be retrieved from the
alpha channel, inverted and the selected content deleted to
expose unchanged image below.
2. The Decrease Color Depth - X Colors step in the script causes
the image to be flattened with loss of your layers. If you
don't want that to happen, first do a Copy Merged and a Paste
As New Image. Run the script on the new image and then Copy
Merged and paste the result back into your original image as
a new layer.

Other tweaks:
1. You can experiment with changing the Overlay blend mode of
the texture layer to Hard Light, Soft Light or Luminance
(Legacy) for a different effect.
2. You can rotate your image clockwise 90 degrees, run the
script, and rotate back counterclockwise 90 degrees. This
will change the orientation of the stitches.
3. You can save your image as PNG, open the PNG file, and run
the script skipping (with Cancel) the color reduction step.
When saving with the PNG Optimizer in Palette-Based mode
you have a choice of Optimized Octree as well as the Median
Cut method of color reduction. Only the latter is available
in the script but the former often produces truer colors.
jc

2007-05-23, 6:19 pm

This one works with my PSP X french version.
Thank you.
JC


Spandex Rutabaga

2007-05-23, 6:19 pm

Spandex Rutabaga wrote:

> Other tweaks:
> 1. You can experiment with changing the Overlay blend mode of
> the texture layer to Hard Light, Soft Light or Luminance
> (Legacy) for a different effect.
> 2. You can rotate your image clockwise 90 degrees, run the
> script, and rotate back counterclockwise 90 degrees. This
> will change the orientation of the stitches.
> 3. You can save your image as PNG, open the PNG file, and run
> the script skipping (with Cancel) the color reduction step.
> When saving with the PNG Optimizer in Palette-Based mode
> you have a choice of Optimized Octree as well as the Median
> Cut method of color reduction. Only the latter is available
> in the script but the former often produces truer colors.


The attached shows some variations in the output achievable by
these steps and by resizing. The image is from Joelle. Some
additional tweaks are:

4. In place of suggestion 2, try Image > Mirror instead to
produce further variations in the direction and lighting of
the stitches.
5. With the Texture Overlay layer active, apply Histogram Stretch.
It makes the stitches seem shinier. Then experiment with the
suggested blend modes.
6. Also try lowering the opacity of the Texture Overlay layer.
Spandex Rutabaga

2007-05-23, 6:19 pm

jc wrote:
>
> This one works with my PSP X french version.


Good.
Vanessa

2007-05-23, 10:32 pm

I can't get this one to work with version 8, Spandex........


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:4654A010.B2D2F80F@agabatur.xednaps...
> Spandex Rutabaga wrote:
>
>
> The attached shows some variations in the output achievable by
> these steps and by resizing. The image is from Joelle. Some
> additional tweaks are:
>
> 4. In place of suggestion 2, try Image > Mirror instead to
> produce further variations in the direction and lighting of
> the stitches.
> 5. With the Texture Overlay layer active, apply Histogram Stretch.
> It makes the stitches seem shinier. Then experiment with the
> suggested blend modes.
> 6. Also try lowering the opacity of the Texture Overlay layer.



Rusty

2007-05-24, 3:17 am


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:4654A010.B2D2F80F@agabatur.xednaps...
> Spandex Rutabaga wrote:
>
>
> The attached shows some variations in the output achievable by
> these steps and by resizing. The image is from Joelle. Some
> additional tweaks are:
>
> 4. In place of suggestion 2, try Image > Mirror instead to
> produce further variations in the direction and lighting of
> the stitches.
> 5. With the Texture Overlay layer active, apply Histogram Stretch.
> It makes the stitches seem shinier. Then experiment with the
> suggested blend modes.
> 6. Also try lowering the opacity of the Texture Overlay layer.


Thank you so much for revising my grandson's script. He is an IT student at
university and I'm sure he will appreciate and learn from you valuable
input.

Cheers,
Ken Russell


Spandex Rutabaga

2007-05-24, 3:17 am

Vanessa wrote:
>
> I can't get this one to work with version 8, Spandex........


What exact error message are you getting in the Script Output
Palette? (Turn it on with View > Palettes if you can't see it.)
Copy and paste the error text into a post. Also please report
the exact version of PSP 8 you have. See Help > About Paint Shop
Pro.
BWPanda

2007-05-24, 6:27 am

Hi everyone,

My name's Peter Anderson and I'm new to this newsgroup.
My Grandad (Rusty) originally posted my tapestry script here, and I'm happy
to see you've now got a version that works for everyone.

As previously stated, I'm a Uni student in my third year of IT. One of my
classes showed us how to make a tapestry effect in Photoshop using a similar
method to that in the original script. I loved the effect so worked out how
to do it in PSP and made a script of it.
I'm now slowly working on a script that will convert an image to a proper
tapestry grid with symbols you can print off and use in a scross-stitch,
etc. I'll post it here if I ever get it done.

Glad you like the script, and thanks for the rework Spandex!

Peter Anderson.


Joëlle

2007-05-24, 6:27 am


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:465495DC.476CB3AC@agabatur.xednaps...
> The attached contains a reworked version of the Tapestry Script
> created by Peter Anderson and posted by Rusty. It contains a
> number of changes.
>
> The principle of the script is to apply a 10 x 10 pixel texture
> overlay to the image. There are some color simplification steps
> and tweaks to the steps to mimic the limited number of thread
> colors available in embroidery.
>
> I've tried to fix various issues:

<snip>



I especially like the line after the 'copyright' !
Well done Veggie :-))

Joëlle


Vanessa

2007-05-24, 6:27 am

underprocessable
SuzShook

2007-05-24, 6:28 pm

Move the True and False lines ( lines 12 and 13 in the script) to column 1
and the script will run. Suz

Vanessa wrote:[color=darkred]
> Version 8.10 Spandex.......
> "Traceback (most recent call last):
>
> File "C:\Documents and Settings\Vanessa\My Documents\~PAINT SHOP PRO
> 8\Plugins\Scripts
> Restricted\Spandex_TapestryStitchRutabaga.PspScript", line 46, in Do
>
> App.Do( Environment, 'Resize', {
>
> NameError: global name 'True' is not defined"
>
>
> "Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
> news:46551721.48B1D711@agabatur.xednaps...


Spandex Rutabaga

2007-05-24, 6:28 pm

Vanessa wrote:
>
> Version 8.10 Spandex.......
> "Traceback (most recent call last):
>
> File "C:\Documents and Settings\Vanessa\My Documents\~PAINT SHOP PRO
> 8\Plugins\Scripts Restricted\Spandex_TapestryStitchRutabaga.PspScript", line
> 46, in Do
>
> App.Do( Environment, 'Resize', {
>
> NameError: global name 'True' is not defined"


Thanks. Try the attached version please.
Spandex Rutabaga

2007-05-24, 6:28 pm

SuzShook wrote:
>
> Move the True and False lines ( lines 12 and 13 in the script) to column 1
> and the script will run. Suz


Yep, I messed that up. What do you expect from a vegetable? :)
Vanessa

2007-05-24, 6:28 pm

underprocessable
Spandex Rutabaga

2007-05-24, 6:28 pm

BWPanda wrote:
>
> Hi everyone,
>
> My name's Peter Anderson and I'm new to this newsgroup.


> One of my
> classes showed us how to make a tapestry effect in Photoshop using a similar
> method to that in the original script.


When Rusty originally asked about tapestry scripts I mentioned
that it could be as easy as applying a texture of the right kind
and scale to the image, which is what the Photoshop technique
does. In my experience, people differ in their opinions of how
a tapestry/embroidery/cross-stitch/whatever should look like
and they often want to apply the effect to very small images
in which the detail is small compared to the stitch size. Meeting
all these requirements is not necessarily with a finite number
of pixels to work with :) Another problem that is not easy to
address with the texture filling technique is the irregularity
in appearance and placement from stitch to stitch as, for
instance, in the attached. Some examples, though not necessarily
fully representative of all I have seen people create in PSP,
can be found here http://www.psplinks.com/cgi-bin/search.cgi by
typing search terms such as: weave, stitch, embroider, tapestry,
denim, silk, satin, and the like. Perhaps you'll find these a
stimulant :)

> I loved the effect so worked out how
> to do it in PSP and made a script of it.
> I'm now slowly working on a script that will convert an image to a proper
> tapestry grid with symbols you can print off and use in a scross-stitch,
> etc. I'll post it here if I ever get it done.


An embroidery project would probably use fewer than 20 colors
of thread and likely even less. One of the harder things to
achieve is a color reduction to a small number of colors while
producing the most realistic shading and final color selection.
This is particularly tricky when you are trying to represent
skintones. That's key to a successful embroidery pattern but
it is not necessarily easy to achieve in PSP. An example of
the current script run on an image someone wanted to enhance
is attached to illustrate the problem.

> Glad you like the script, and thanks for the rework Spandex!


It wouldn't have happened without your work.
Spandex Rutabaga

2007-05-24, 6:28 pm

Vanessa wrote:
>
> Now, if
> somebody could only help me out with the loss of my right click option in
> the layers pallette I would be most content..............


Have you tried View > Customize > Menu. Then Show Menus For:
Image in the left hand droplist, and Select Context Menu: Layer
Context Menu from the right hand droplist. Finally press the
right hand Reset button.
SuzShook

2007-05-24, 6:28 pm



Spandex Rutabaga wrote:
> SuzShook wrote:
>
> Yep, I messed that up. What do you expect from a vegetable? :)


Dinner????


Spandex Rutabaga

2007-05-24, 6:28 pm

SuzShook wrote:
>
> Spandex Rutabaga wrote:


>
> Dinner????


I'd love to buy you dinner some time :->
SuzShook

2007-05-24, 6:28 pm

Spandex Rutabaga wrote:
> SuzShook wrote:
>
>
> I'd love to buy you dinner some time :->


Now that would be a meeting I'd "relish"!


path

2007-05-24, 6:28 pm


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:4655A340.33D2C1BD@agabatur.xednaps...
> BWPanda wrote:
>
>
> When Rusty originally asked about tapestry scripts I mentioned
> that it could be as easy as applying a texture of the right kind
> and scale to the image, which is what the Photoshop technique
> does. In my experience, people differ in their opinions of how
> a tapestry/embroidery/cross-stitch/whatever should look like
> and they often want to apply the effect to very small images
> in which the detail is small compared to the stitch size. Meeting
> all these requirements is not necessarily with a finite number
> of pixels to work with :) Another problem that is not easy to
> address with the texture filling technique is the irregularity
> in appearance and placement from stitch to stitch as, for
> instance, in the attached. Some examples, though not necessarily
> fully representative of all I have seen people create in PSP,
> can be found here http://www.psplinks.com/cgi-bin/search.cgi by
> typing search terms such as: weave, stitch, embroider, tapestry,
> denim, silk, satin, and the like. Perhaps you'll find these a
> stimulant :)
>
>
> An embroidery project would probably use fewer than 20 colors
> of thread and likely even less.


Hmmmm, not always. I have several cross-stitch embroidery patterns that
take close to 100 colors. Some are so close in color that you have to keep
them close to the label or throw them away. It is also the reason I ended
up wearing glasses... working on very fine aida cloth or linen. *grin* I
had great fun with the designs though and they are framed and hanging in
several homes. (Not 'several' of my homes... other people, lol)
Pat


One of the harder things to
> achieve is a color reduction to a small number of colors while
> producing the most realistic shading and final color selection.
> This is particularly tricky when you are trying to represent
> skintones. That's key to a successful embroidery pattern but
> it is not necessarily easy to achieve in PSP. An example of
> the current script run on an image someone wanted to enhance
> is attached to illustrate the problem.
>
>
> It wouldn't have happened without your work.




Spandex Rutabaga

2007-05-24, 6:28 pm

path wrote:
>
> "Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
> news:4655A340.33D2C1BD@agabatur.xednaps...


>
> Hmmmm, not always.


I guess that's why I used the word "probably" :)

> I have several cross-stitch embroidery patterns that
> take close to 100 colors. Some are so close in color that you have to keep
> them close to the label or throw them away.


Perhaps is would pay you to buy a spectrometer :)
Rusty

2007-05-24, 6:28 pm


"BWPanda" <panda@aapt.net.au> wrote in message news:4653eb63_1@cnews...
> Hi everyone,
>
> My name's Peter Anderson and I'm new to this newsgroup.
> My Grandad (Rusty) originally posted my tapestry script here, and I'm
> happy to see you've now got a version that works for everyone.
>
> As previously stated, I'm a Uni student in my third year of IT. One of my
> classes showed us how to make a tapestry effect in Photoshop using a
> similar method to that in the original script. I loved the effect so
> worked out how to do it in PSP and made a script of it.
> I'm now slowly working on a script that will convert an image to a proper
> tapestry grid with symbols you can print off and use in a scross-stitch,
> etc. I'll post it here if I ever get it done.
>
> Glad you like the script, and thanks for the rework Spandex!
>
> Peter Anderson.
>

Welcome to the group Peter. You sound like a very intelligent bright boy -
you must take after your grandfather!

Disclaimer:
I have never met this person before and we are not related :-)

Grandad
oops.... I mean Rusty



Joëlle

2007-05-24, 6:28 pm


"Rusty" <kenrussell@optus YOUR HAT home.com.au> wrote in message
news:4654aa4f$1_3@cnews...
>
> "BWPanda" <panda@aapt.net.au> wrote in message news:4653eb63_1@cnews...
> Welcome to the group Peter. You sound like a very intelligent bright
> boy - you must take after your grandfather!
>
> Disclaimer:
> I have never met this person before and we are not related :-)
>
> Grandad
> oops.... I mean Rusty
>
>
>



Oh you are just like my husband's grandfather, who took his wife to France
on holiday, many years ago. On the way back he smuggled a bottle of sherry
into her luggage. When confronted by the Customs officer (you weren't
allowed to bring in such things into the UK without paying duty), the wife
turned to her husband with a pleading look not knowing where this bottle
came from, her husband turned around and said "My good woman, I have never
met you before in my life"!!

Poor Peter will never live this down, being disowned by his grandpa..
:-)
Joëlle


path

2007-05-24, 10:52 pm


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:4655F920.7F404876@agabatur.xednaps...
> path wrote:
>
>
> I guess that's why I used the word "probably" :)
>
>
> Perhaps is would pay you to buy a spectrometer :)


Thanks, but I have enough gadgets taking up space. Anyway, I discovered
photography and computers now, so......... all my money is gone. ;-)
Pat


Spandex Rutabaga

2007-05-25, 3:19 am

Vanessa wrote:
>
> That worked too, Spandex...........thank you so very very
> much..........*g*......you are a life saver


You're welcome, but I'm not a lifesaver - I'm a vegetable.
I'm the one on the right, not the left, in the attachment.
Vanessa

2007-05-25, 3:19 am

lololol.............


"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:46566145.45891F89@agabatur.xednaps...
> Vanessa wrote:
>
> You're welcome, but I'm not a lifesaver - I'm a vegetable.
> I'm the one on the right, not the left, in the attachment.



John Andrisan

2007-05-27, 6:19 pm

underprocessable
Joëlle

2007-05-27, 6:19 pm


"John Andrisan" <andrisan@pacbell.net> wrote in message
news:465864ec_2@cnews...
> here's my cat Huffy on a tapestry...
> john
>
>
>
>



Very nice tapestry (and cat).
:-)
Joëlle


Spandex Rutabaga

2007-05-27, 6:19 pm

John Andrisan wrote:
>
> here's my cat Huffy on a tapestry...


This could be the start of a tapestry cat-alog :)
John Andrisan

2007-05-28, 6:18 pm

underprocessable
John Andrisan

2007-05-28, 6:18 pm

I used the script, then performed an undo, and used the script again... and
it failed.
Here's the script output:

Executing FileClose
Executing FileOpen
Executing RunScript
Executing EnableOptimizedScriptUndo
Executing Resize
Executing Pixelate
Executing DecreaseColorsToX
Executing IncreaseColorsTo16Million
Executing Gaussian Blur
Executing New Raster Layer
Executing SelectLayer
Executing Fill

Script 'TapestryStitchSpandexRutabaga' has completed successfully.
(I did an undo at this point)

Executing RunScript
Executing EnableOptimizedScriptUndo
Executing Resize
Executing Pixelate
Executing IncreaseColorsTo16Million
Unknown error occurred with command IncreaseColorsTo16Million
Unknown error occurred with command Pixelate
Traceback (most recent call last):
File "C:\Documents and Settings\Owner\My Documents\My PSP
Files\Scripts-Restricted\
TapestryStitchSpandexRutabaga.PspScript", line 66, in Do
App.Do( Environment, 'Pixelate', {
RuntimeError: The script could not be executed.

Script 'TapestryStitchSpandexRutabaga' has completed with an error.






Spandex Rutabaga

2007-05-28, 6:18 pm

John Andrisan wrote:
>
> I used the script, then performed an undo, and used the script again... and
> it failed.


I don't think it has anything to do with using the script more
than once.

> Here's the script output:
>
> Executing FileClose
> Executing FileOpen
> Executing RunScript
> Executing EnableOptimizedScriptUndo
> Executing Resize
> Executing Pixelate
> Executing DecreaseColorsToX
> Executing IncreaseColorsTo16Million
> Executing Gaussian Blur
> Executing New Raster Layer
> Executing SelectLayer
> Executing Fill
>
> Script 'TapestryStitchSpandexRutabaga' has completed successfully.
> (I did an undo at this point)
>
> Executing RunScript
> Executing EnableOptimizedScriptUndo
> Executing Resize
> Executing Pixelate


Oh, look the DecreaseColorsToX command is missing! Did you cancel
out of it? If you did then the image is still at 16.7 million
colors and promoting to 16.7 million colors will fail. And it
does, as indicated below. The increase color depth command has
to be executed conditionally if you're going to skip the color
reduction step.

> Executing IncreaseColorsTo16Million
> Unknown error occurred with command IncreaseColorsTo16Million
> Unknown error occurred with command Pixelate
> Traceback (most recent call last):
> File "C:\Documents and Settings\Owner\My Documents\My PSP
> Files\Scripts-Restricted\
> TapestryStitchSpandexRutabaga.PspScript", line 66, in Do
> App.Do( Environment, 'Pixelate', {
> RuntimeError: The script could not be executed.
>
> Script 'TapestryStitchSpandexRutabaga' has completed with an error.


The attached script will conditionally promote to 16.7 million
colors. It should work in PSP X and PSPP XI if these versions
are properly backwards compatible but I have not tested it in
these versions. Nor will I. You guys might want to try it out.
Vanessa

2007-05-29, 3:18 am

Very effective, John..;-)

"John Andrisan" <andrisan@pacbell.net> wrote in message
news:4659d4f1_2@cnews...
> Another cat-tapestry (try saying that fast!!!).
>
> This one is of Whiskers, who was my companion for 17+ years. He's gone
> now.
>
> I had to adjust the pixel sizes a little.
> john
>
>
>



John Andrisan

2007-05-29, 6:24 pm

>Oh, look the DecreaseColorsToX command is missing! Did you cancel out of
it?
No. /john


Spandex Rutabaga

2007-05-29, 6:24 pm

John Andrisan wrote:
>
> it?
> No. /john


It looks as if your computer is possessed by demons :) Are
all your Auto Action settings at the defaults? (See File >
Preferences > General Program Preferences > Auto Action tab).
Does the modified script I posted fix your problem?
John Andrisan

2007-05-29, 10:30 pm

>Does the modified script I posted fix your problem?
Yes and it fails the same way.

>Are all your Auto Action settings at the defaults?

I reset them and nothing seemed to change for this problem.

I'll try a few debugging attempts: 1. add some say statements, 2. do some
showconstants, 3. what else?

I'm using Win/XP/SP1 and PSP 9 with all its updates.
john


Spandex Rutabaga

2007-05-30, 3:16 am

John Andrisan wrote:
>
> Yes and it fails the same way.


Are you sure you are really running the modified script? When
you have two or more resources of the same name PSP will run
the first one it finds and you aren't necessarily clear which
one it is. I ask this because I could reproduce your problem
with the original script if I canceled out of the Decrease
Color Depth - X Colors dialog. (That represented a shortcoming
in the original script.) However, the new script (the one with
the number 1 in its name) no longer exhibits the problem. If
I do/undo/redo the original script or the new script I never
see any error message and I see the expected result. This is
true whether or not I change the settings at the resize and/or
color reduction step.

Ah! I have just discovered that if you run the script silently
it fails on redo. You didn't say you were running it silently.
Are you? The error message I got was (1) a successful run and
(2) a failure on the repeated run, which showed up in the Script
Output Palette as:
Script 'TapestryStitch1SpandexRutabaga' has completed successfully.
Executing IncreaseColorsTo16Million
Unknown error occurred with command IncreaseColorsTo16Million
Unknown error occurred with command RedoLastUndo

The image also turns black and the image window doesn't update
properly. I have no idea why this problem is happening but suspect
a bug in PSP. Scripts are supposed to run the same whether
interactive or silent, i.e. the commands and their parameters
and their consequences should be identical.

Maybe Suz Shook can shed some light on this when she rematerializes.
In the interim, run the script in Interactive mode.
SuzShook

2007-05-30, 6:21 pm

Spandex Rutabaga wrote:
> John Andrisan wrote:
>
> Are you sure you are really running the modified script? When
> you have two or more resources of the same name PSP will run
> the first one it finds and you aren't necessarily clear which
> one it is. I ask this because I could reproduce your problem
> with the original script if I canceled out of the Decrease
> Color Depth - X Colors dialog. (That represented a shortcoming
> in the original script.) However, the new script (the one with
> the number 1 in its name) no longer exhibits the problem. If
> I do/undo/redo the original script or the new script I never
> see any error message and I see the expected result. This is
> true whether or not I change the settings at the resize and/or
> color reduction step.
>
> Ah! I have just discovered that if you run the script silently
> it fails on redo. You didn't say you were running it silently.
> Are you? The error message I got was (1) a successful run and
> (2) a failure on the repeated run, which showed up in the Script
> Output Palette as:
> Script 'TapestryStitch1SpandexRutabaga' has completed successfully.
> Executing IncreaseColorsTo16Million
> Unknown error occurred with command IncreaseColorsTo16Million
> Unknown error occurred with command RedoLastUndo
>
> The image also turns black and the image window doesn't update
> properly. I have no idea why this problem is happening but suspect
> a bug in PSP. Scripts are supposed to run the same whether
> interactive or silent, i.e. the commands and their parameters
> and their consequences should be identical.
>
> Maybe Suz Shook can shed some light on this when she rematerializes.
> In the interim, run the script in Interactive mode.


I, too, get this error, but I don't know why. I believe the error is in the
Pixelate command, because if you try to execute that command on the image
(outside the script) after the "undo", PSP hangs on that command. There's
something in the image (or environment) PSP does not like after that script
is "undone", and it chokes on the Pixelate command (actually, it chokes on
the Increase Colors to 16 Million command). Strangely enough, if you change
the Execution mode on the Pixelate command in the script to Interactive, the
error does not occur on the rerun, even on successive reruns. However, if
you run that script one time with the Execution mode on the Pixelate command
set to Silent, and undo the script, the problem crops up. I've even had all
sorts of things overlay the image, like pieces of the dialogs, or even
pieces of this post as I flipped back and forth between this post and PSP X.
I have no idea why this is occurring. The same thing happens in PSP XI. Suz


Spandex Rutabaga

2007-05-30, 6:21 pm

SuzShook wrote:
>
> Spandex Rutabaga wrote:
>
> I, too, get this error, but I don't know why. I believe the error is in the
> Pixelate command, because if you try to execute that command on the image
> (outside the script) after the "undo", PSP hangs on that command. There's
> something in the image (or environment) PSP does not like after that script
> is "undone", and it chokes on the Pixelate command (actually, it chokes on
> the Increase Colors to 16 Million command). Strangely enough, if you change
> the Execution mode on the Pixelate command in the script to Interactive, the
> error does not occur on the rerun, even on successive reruns. However, if
> you run that script one time with the Execution mode on the Pixelate command
> set to Silent, and undo the script, the problem crops up.


Does the same thing happen if you run Pixelate in Silent mode
but insert some "do nothing" command like Image > Count Image
Colors or Image > Image Information after Pixelate but before
Increase Color Depth? Just grasping at straws, though I believe
trying some trick like that would be hampered by the lack of a
reliable way to determine whether the script was running Silent
or Interactive.

> I've even had all
> sorts of things overlay the image, like pieces of the dialogs, or even
> pieces of this post as I flipped back and forth between this post and PSP X.
> I have no idea why this is occurring. The same thing happens in PSP XI.


You are right about the different behavior between Silent and
Interactive. I also get the debris on the screen that you
describe. I think this is caused by a bug in PSP and that someone
should report it to Corel. Would you?

A workaround would be to replace the Pixelate command with these
steps:
1. Resize to 10% using Weighted Average resampling.
2. Immediately resize to 1000% again using Weighted Average
resampling.
This produces the requisite blocky appearance. The results are
not identical to Pixelate but not too different either and the
overall appearance may be quite adequate for the subsequent
steps.

I hesitate to make the change however because it could end up
being a gotcha for newbies without any knowledge of what is
happening inside the script. Their Image > Resize dialog would
be left with a 1000% size setting, which could exhaust memory
by increasing the number of pixels a hundred-fold if you don't
look carefully. More insidiously the resampling mode is left
as one that is never normally used and which impacts image
quality negatively while the resampling setting is less likely
to be noticed or understood by newbies. A second nuisance is
rounding of percentages to an integral number of pixels. As a
result the final size of the image might not be the pixel size
selected in the resize step that is currently in the script if
the operator selects image dimensions not divisible by ten.

Any thoughts on how to get around this issue? I'm not sure
whether people would normally want to run the script in
Silent mode or what happens if the script is run in a batch
process.
SuzShook

2007-05-30, 6:21 pm

Spandex Rutabaga wrote:
> SuzShook wrote:
>
> Does the same thing happen if you run Pixelate in Silent mode
> but insert some "do nothing" command like Image > Count Image
> Colors or Image > Image Information after Pixelate but before
> Increase Color Depth? Just grasping at straws, though I believe
> trying some trick like that would be hampered by the lack of a
> reliable way to determine whether the script was running Silent
> or Interactive.
>
>
> You are right about the different behavior between Silent and
> Interactive. I also get the debris on the screen that you
> describe. I think this is caused by a bug in PSP and that someone
> should report it to Corel. Would you?
>
> A workaround would be to replace the Pixelate command with these
> steps:
> 1. Resize to 10% using Weighted Average resampling.
> 2. Immediately resize to 1000% again using Weighted Average
> resampling.
> This produces the requisite blocky appearance. The results are
> not identical to Pixelate but not too different either and the
> overall appearance may be quite adequate for the subsequent
> steps.
>
> I hesitate to make the change however because it could end up
> being a gotcha for newbies without any knowledge of what is
> happening inside the script. Their Image > Resize dialog would
> be left with a 1000% size setting, which could exhaust memory
> by increasing the number of pixels a hundred-fold if you don't
> look carefully. More insidiously the resampling mode is left
> as one that is never normally used and which impacts image
> quality negatively while the resampling setting is less likely
> to be noticed or understood by newbies. A second nuisance is
> rounding of percentages to an integral number of pixels. As a
> result the final size of the image might not be the pixel size
> selected in the resize step that is currently in the script if
> the operator selects image dimensions not divisible by ten.
>
> Any thoughts on how to get around this issue? I'm not sure
> whether people would normally want to run the script in
> Silent mode or what happens if the script is run in a batch
> process.


I don't think the problem is with the Pixelate command itself, as if you
remove the DecreaseColorsToX command following the Pixelate command, there
is no error on rerun. I think PSP is not undoing the Decrease Colors
command correctly, so it needs to Increase Colors to perform the Pixelate
command again. The image has been compromised by the bad "undo", so nothing
else seems to work for that image. Though the screen representation of the
image gets filled with junk, if you save the image and reopen, it's the good
image, without all the junk. I've tried lots of things to get it to work,
even inserting a conditional IncreaseColorDepth command in the script, but
nothing seems to work other than hard-coding the Pixelate command as
Interactive - that prevents the problem.

I have reported this to Corel, though I doubt another patch is on the
horizon - I'm betting a new version is where all the efforts are being
concentrated at this time of year, but that's just my gut feeling. Suz


Spandex Rutabaga

2007-05-30, 6:21 pm

SuzShook wrote:

> I have reported this to Corel, though I doubt another patch is on the
> horizon -


Even if it were it's not clear whether anyone would fix this.
Interesting how many versions have had the problem before we
stumbled on it. Thanks for reporting it.

> I'm betting a new version is where all the efforts are being
> concentrated at this time of year, but that's just my gut feeling.


They are likely to be working on a new version but my guess
is that the real efforts are primarily devoted to keeping a
job and to self-advancement. They usually are in larger
companies whose primary goal is to return substantial profits
to venture capital investors on the fastest time scale possible.
John Andrisan

2007-05-30, 6:21 pm

>Are you sure you are really running the modified script?
Yes, I named it with a suffix of 'fix' and when I selected it from PSP's
menu I could see the full name in the yellow window that appears when you
hold the cursor arrow on on the name.

> You didn't say you were running it silently. Are you?

Yes.

>The image also turns black and the image window doesn't update properly.

Aha! My image remained but got a little smaller and a small portion of the
script output window was inserted on the right... a sample is attached.
Hmmmm, when I saved it all I could see was the original image, not the added
script output. So no attachment now.

BTW, when I worked at McDonnell Douglas as a mainframe sysprog, one of my
chores was to find
bugs in IBM and other vendor s/w... They got to know me well!
john


John Andrisan

2007-05-30, 6:21 pm

>I think this is caused by a bug in PSP and that someone should report it to
Corel. Would you?
I'm not a PSP X user, so they may just ignore my request to fix PSP 9.

I tried tapestry on a gif file and got no error. Not sure if that was just
a lucky try.
john




Spandex Rutabaga

2007-05-30, 6:21 pm

John Andrisan wrote:

> BTW, when I worked at McDonnell Douglas as a mainframe sysprog, one of my
> chores was to find
> bugs in IBM and other vendor s/w...


Apparently your skills are transferrable to image editing
software :)
Spandex Rutabaga

2007-05-30, 6:21 pm

Spandex Rutabaga wrote:

> Apparently your skills are transferrable


Sorry about the excessive number of "r"s in transferable. They
were having a sale on them today.
John Andrisan

2007-05-31, 6:21 pm

When I use interactive mode I get a pause for the resize and decrease color
depth dialogs. No other dialogs are paused at.

Aren't other App.Do s like pixilate, increasecolorsto16million,
gaussianblur, and newrasterlayer also dialogs? Why aren't they paused at
during the script run?
john





John Andrisan

2007-05-31, 6:21 pm

Aha! I've solved my own curios problem ...

For some reason 'ExecutionMode': App.Constants.ExecutionMode.Silent, was
applied to some dialogs and not others.

Sorry about my previous comment.
john


Spandex Rutabaga

2007-05-31, 6:21 pm

John Andrisan wrote:
>
> Aha! I've solved my own curios problem ...
>
> For some reason 'ExecutionMode': App.Constants.ExecutionMode.Silent, was
> applied to some dialogs and not others.


If you go back and read my original post in this thread you'll
see why. Everything is geared to a 10 x 10 pixel texture that
is tiled. It makes no sense to use anything other that a 10 x 10
pixel Pixelate setting as well as a Gaussian Blur tuned to that
size of tile.
John Andrisan

2007-05-31, 10:34 pm

The image that's causing me problems is a result of one of my PaintBrush
scripts, and is about 3.5 megabytes, far too large to post on this
newsgroup. May I send it to you separately?

A pixel size of 10 it doesn't seem right ... and that's why I was trying to
change the value in several runs. My problem could be something else.
john



Spandex Rutabaga

2007-05-31, 10:34 pm

John Andrisan wrote:
>
> The image that's causing me problems is a result of one of my PaintBrush
> scripts, and is about 3.5 megabytes, far too large to post on this
> newsgroup. May I send it to you separately?


No, I'm afraid you can't, if only because my email is currently
broken.

> A pixel size of 10 it doesn't seem right ... and that's why I was trying to
> change the value in several runs.


Just look at the original texture image posted by Rusty. It is
10 x 10 pixels. There's nothing wrong with it. I've attached it
here again.

> My problem could be something else.


I dare say but I haven't a clue what problem you are talking
about. When I run this script interactively in PSP 9 I have
yet to have a problem. I've run it on 27 MB images for example.

Bear in mind that the texture is applied to the underlying
layer using the Overlay blend mode. Wherever the lower (i.e.
original image layer) is pure black or pure white you won't
see any texture in the result with the texture overlay because
of the math of this blend mode, which you can find here
http://www.pegtop.net/delphi/articl...des/overlay.htm
So the message is "don't use a white or black background for
your vector objects".
John Andrisan

2007-06-01, 6:18 pm

>So the message is "don't use a white or black background for your vector
objects".
Aha! I use a white background in this one...

Thanks for your help and the url you suggested.
john


Sponsored Links


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