Copy link to clipboard
Copied
What if we set the pixel ratio? For example, 1000x1000 pixel is Blur 3 radius pixels. 2000x2000 pixel is blur 6 radius pixels. If it's 1500x1500 pixels, can you make scripts to add how much blur radius... Before clicking the scripts, I'll set the selection with rectangular marquee tools and how many pixels to set.
@Thiha31203570tbl0 – Is this related to your similar post below?
If performing frequency separation, it is normally done on the entire canvas, not a selection. It can always be masked afterwards.
// 2023, use it at your own risk;
if (app.documents.length > 0) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
if (hasSelection() == true) {
var theBounds = activeDocument.selection.bounds;
var theWidth = theBounds[2] - theBounds[0];
var theHeight = theBounds[3] - theBounds[1];
var theValue = Math.max(theWidth, theHeight) * 0.003;
gaussianBlur (theValue)
};
app.preferences.rulerUnits
...
// 2024, use it at your own risk;
if (app.documents.length > 0) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
if (hasSelection() == true) {
var theBounds = activeDocument.selection.bounds;
var theWidth = theBounds[2] - theBounds[0];
var theHeight = theBounds[3] - theBounds[1];
var theValue = Math.max(theWidth, theHeight) * 0.003;
surfaceBlur (theValue, 10)
};
app.preferences.rulerUnits
...
For one thing a function that takes three arguments should be fed three arguments.
// 2024, use it at your own risk;
if (app.documents.length > 0) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
if (hasSelection() == true) {
var theBounds = activeDocument.selection.bounds;
var theWidth = theBounds[2] - theBounds[0];
var theHeight = theBounds[3] - theBounds[1];
var theValue = Math.max(theWidth, theHeight) * 0.021;
unsharpMask (120, theValue, 10)
...
Copy link to clipboard
Copied
I am also puzzled as to why you need a script approach. The blur radius is chosen by image content, not pixel size, thereby choosing what is on the high frequency layer and what is on the low. A script could give a mathematical output based on image pixel size but can't make that judgement based on image content.
Dave
Copy link to clipboard
Copied
Hello Dear Mr.@Stephen Marsh @c.pfaffenbichler , Can you help me?
The selection is for setting the blur ratio.
However, the effect of the Blur effect is not only to apply the effect within the selected area, but also to apply the effect to the entire image.
Copy link to clipboard
Copied
Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible?
Copy link to clipboard
Copied
Thank Sir ,
Copy link to clipboard
Copied
Those are not the screenshots I asked for.
Copy link to clipboard
Copied
Thank Mr. @c.pfaffenbichler @Stephen Marsh
I want the blur effect to be applied to the whole image