ResampleMethod.PRESERVEDETAILS question
Hi,
is there any trick to achieve the Preserve Details 2.0 method in JavaScript, or it is still unsupported?
Thanks,
Laszlo
Hi,
is there any trick to achieve the Preserve Details 2.0 method in JavaScript, or it is still unsupported?
Thanks,
Laszlo
Not sure about DOM code, however It can be recorded as AM code via ScriptListener and somewhat beautified and made intelligible with the Clean SL script:
imageSize();
function imageSize() {
var c2t = function (s) {
return app.charIDToTypeID(s);
};
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
descriptor.putUnitDouble( s2t( "width" ), s2t( "percentUnit" ), 200.000000 ); // 200% resample value
descriptor.putBoolean( s2t( "scaleStyles" ), true );
descriptor.putBoolean( s2t( "constrainProportions" ), true );
descriptor.putEnumerated( c2t( "Intr" ), s2t( "interpolationType" ), s2t( "deepUpscale" )); // Preserve Details 2.0
descriptor.putInteger( s2t( "noise" ), 25 ); // Reduce Noise
executeAction( s2t( "imageSize" ), descriptor, DialogModes.NO );
}
EDIT: In CC2018 I can only get DOM code to work for the original Preserve Details algorithm, not Preserve Details 2.0 which has no entry in the JS Reference:
app.activeDocument.resizeImage( '200%', '200%', undefined, ResampleMethod.PRESERVEDETAILS, 25 )
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.