It operates on an image like this:

and when working properly fills ground and sky with two gradients. But now the result looks like this:

I haven't got very far in isolating the cause but I think it must be due to some change in the size and/or position of the image window since the script's initial development. So I'm going to try writing it from scratch, but only after I've understood a fundamental point.
Q: How can I set an image window's size and position to specific values, so that lines like
Code: Select all
Point': (83.625,181.125),have predictable results?
Earlier steps ensure that the elevation profile always has empty space below its lowest elevation. So there is always a point along the bottom where a fill could be safely applied. Ditto the top.
P.S. As a side issue, I've been using the command
Code: Select all
exitCode: Select all
from JascApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'Paint Shop Pro',
'Host Version': u'8.10'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
})
# Fill 1
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': u'Duotone green',
'GradientType': App.Constants.GradientType.Linear,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': None,
'FocalPoint': None,
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (83.625,181.125),
'SampleMerged': App.Constants.Boolean.true,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# NormalViewing
App.Do( Environment, 'NormalViewing', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# Fill 2
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': u'Duotone green',
'GradientType': App.Constants.GradientType.Linear,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': None,
'FocalPoint': None,
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (1303.13,180.625),
'SampleMerged': App.Constants.Boolean.true,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# Fill 3
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': u'Duotone green',
'GradientType': App.Constants.GradientType.Linear,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': None,
'FocalPoint': None,
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (896.75,181.55),
'SampleMerged': App.Constants.Boolean.true,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# NormalViewing
App.Do( Environment, 'NormalViewing', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# Fill 4
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': u'Duotone light blue',
'GradientType': App.Constants.GradientType.Linear,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': None,
'FocalPoint': None,
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (85.5,36.5),
'SampleMerged': App.Constants.Boolean.true,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
# Fill 5
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': None,
'Pattern': None,
'Gradient': {
'Name': u'Duotone light blue',
'GradientType': App.Constants.GradientType.Linear,
'Angle': 0,
'RepeatCount': 0,
'RepeatType': App.Constants.RepeatType.Pad,
'ColorStops': None,
'TransparencyStops': [],
'CenterPoint': None,
'FocalPoint': None,
'Invert': App.Constants.Boolean.false
},
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (1302.5,34.5),
'SampleMerged': App.Constants.Boolean.true,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
