Copy link to clipboard
Copied
Hi,
I am resizing the images using the below steps.
1. Open image with the resolution 600.
2. reducing the resolution to 120 using imageresize menu.
These steps am doing using the below steps using code.
var highResolution = 600, imgResolution = 120
var pdf = File.openDialog("Choose a PDF File");
var doc = psFileOpen(pdf, ".pdf");
doc.trim(TrimType.BOTTOMRIGHT);
doc.trim(TrimType.TOPLEFT);
docresizeImage(null,null,imgResolution,ResampleMethod.BICUBIC); // Resize the image to the resolution 120
function psFileOpen(fileName, fExt)
{
var OpnOpts = null, doc = null;
if(File(fileName).exists)
{
if(fExt == ".eps")
{
try{
OpnOpts = new EPSOpenOptions();
OpnOpts.antiAlias = true;
OpnOpts.constrainProportions = true;
OpnOpts.cropPage = CropToType.ARTBOX;
OpnOpts.resolution = highResolution;
OpnOpts.mode = OpenDocumentMode.RGB;
OpnOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
//doc = app.open(File(fileName), OpnOpts, true);
doc = app.open(File(fileName), OpnOpts);
}catch(e){doc = null;}
}else if(fExt == ".pdf" || fExt == ".ai")
{
try{
OpnOpts = new PDFOpenOptions()
OpnOpts.antiAlias = true;
OpnOpts.constrainProportions = true;
OpnOpts.cropPage = CropToType.ARTBOX;
OpnOpts.resolution = highResolution;
OpnOpts.mode = OpenDocumentMode.RGB;
OpnOpts.bitsPerChannel = BitsPerChannelType.EIGHT;
//doc = app.open(File(fileName), OpnOpts, true);
doc = app.open(File(fileName), OpnOpts);
}catch(e){doc = null;}
}else{
try{
doc = app.open(File(fileName));
}catch(e){doc = null;}
}
return doc;
}else{
return null;
}
}
But having difference in the image quality. How to avoid this.. Please see my screenshots.
Open with the Resolution 600 (Manual)
Reduce the Resolution to 120 (Manual)
Output (Manual)
Output in Automation (Using the above Code)
How to resize the image from one resolution to another resolution without changing the quality. I don't know my method is right? Because there is no issue when it done by manual. Then same way i want to do it using code...
Thanks,
Sudha K
Copy link to clipboard
Copied
If you are resampling an image that has a 600DPI resolution to an image that has a 120DPI resolution you are discarding most of the details you have for the image. You image size data is 20% of the original image size data.. Its like you had $100 gave away $80 and kept $20. You lose image quality resampling an image.
How much quality depends on the size difference, Also downsizing works better than upsizing Upsizinf image apear larger and sodted dows sizinf image apear smaller and sharper. If you display a small image large it will look pixelated as well as soft.
Copy link to clipboard
Copied
I need to resize the image to the resolution 120 but want to open it with that original resolution (ie., image resolution).
when large the image it will pixelated ok but the image looks like dim. please refer my screenshoots for image display.
Manual
Script
When do it in manual image is fine but it script its showing like this. How to avoid this. I want to open the image with its resolution and then change the resolution.
Copy link to clipboard
Copied
First of all resolution is meaningless on a display displays have only their one resolution. If you resample your 300DPI resolution Print image to a 120DPI image the Image would print the same size as the 300DPI Image only because the print will print with large 120dpi pixels not small 300dpi resolution. The image file is 20% of the original image file, If you display the image on your display it will be 20% of the size the 300DPI image. your display has only one ppi resolution. If you zoom in so it displays the same size as the 300dpi file the scaling will be very poor, You discarded 80% of you image scaling it up in size will not regain the quality you discarded.
Copy link to clipboard
Copied
try
ResampleMethod.BICUBICAUTOMATIC
Copy link to clipboard
Copied
I was going to say the samething as r-bin. You have bicubic in your script, but using bicubicautomatic while manually resizing.
Copy link to clipboard
Copied
In Javascript scripting reference for photoshop CS6, there is no option for Bicubicautomatic. Please check below screenshot.
Which one to use to resize image without quality loss. I want to get the same output as when we do it the same in manual. For me its getting deviation.
Copy link to clipboard
Copied
Which CS6 version are you using Perpetual Windows CS6 version 13.0.1.6, Perpetual Mac CS6 version 13.0.6 or Creative Cloud CS6 version 13.1.2.
I repotted a bug in Photoshop soon after CS6 was released. For user had set it as their interpolation preference to Bicubic Automatic. When my script tried to retrieve the users preferences set I wanted to use do the transform I wanted and the restore the users preference Photoshop would report an internal program error in the user set their default to Bicubic Automatic and Photoshop end my script. When my Perpetual CS6 was updated to creative cloud CS6 version 13.1.2 Adobe had fix that bug and my scripts worked again when user set their default to Bicubic Automatic.
Its documented in newer version of Photoshop. Bicubic Automatic was added in CS6 but Adobe was not through and missed adding the support into Scriptingsupport.
Copy link to clipboard
Copied
Since you are using reduction use ResampleMethod.BICUBICSHARPER
This is the same as ResampleMethod.BICUBICAUTOMATIC if there is a reduction in size.
Copy link to clipboard
Copied
Hi,
I had tested all options in resample methods. i noticed BICUBICSHARPER & BICUBICAUTOMATIC (manual) in cs6 is more or less ok but felt some difference in text. I will check it deeply and get back.