Skip to main content
dublove
Legend
May 3, 2026
Answered

Is it possible to make the width on the screen look the same as the actual width?

  • May 3, 2026
  • 4 replies
  • 86 views

Hi everyone.

The code below automatically sets the image to 100% size when it opens, but I later realized that at 350 or 300 dpi, 100% size doesn’t look realistic.

Later, I right-clicked the image in Photoshop, selected the Magnifying Glass tool, right-clicked the image again, and viewed it at print size. It still didn’t feel realistic to me. My image is 15 cm, but the print size appears very small. When I measured the image on the screen with a ruler, it wasn’t 15 cm either.

How can I modify the code below so that the image width in Photoshop looks and feels the same as the printed width?

Thank you.

// Call the zoom function from within suspendHistory
activeDocument.suspendHistory("Set Zoom to 100%", "setZoom(100)");

//// Open the image size dialog
//sTID = function (s) { return app.stringIDToTypeID(s); };
//try {
// executeAction(sTID('imageSize'), undefined, DialogModes.ALL);
//} catch (e) { if (e.number != 8007) { alert("Line: " + e.line + "\n\n" + e, "Bug!", true); throw (e); } }


function setZoom(zoom) {
var docRes = activeDocument.resolution;
try {
cTID = function (s) { return app.charIDToTypeID(s); };
activeDocument.resizeImage(undefined, undefined, 72 / (zoom / 100), ResampleMethod.NONE);
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated(cTID("Mn "), cTID("MnIt"), cTID('PrnS'));
desc.putReference(cTID("null"), ref);
executeAction(cTID("slct"), desc, DialogModes.NO);
activeDocument.resizeImage(undefined, undefined, docRes, ResampleMethod.NONE);
} catch (error) {
if (docRes !== undefined) {
activeDocument.resolution = docRes;
}
alert("Line: " + (error.line || 'unknown') + "\n\n" + error.message, "Bug!", true);
throw error; // Optional to abort the script
}
}

 

    Correct answer D Fosse

    100% in Photoshop has nothing to do with size. It means one image pixel represented by one screen pixel, 1:1.

     

    What you need to do is find the real physical ppi of your screen, by calculating screen pixels/physical measurement in inches. That’s pixel resolution as per panel spec, divided by actual measurement with a ruler.

     

    The resulting number is put into Preferences > Units and Rulers > Screen resolution. Then View > Print size should be accurate.

     

    For instance, my 27 inch 2560 x 1440 monitor is roughly 109 ppi, give or take a pixel.

    4 replies

    Conrad_C
    Community Expert
    Community Expert
    May 4, 2026

    Photoshop has at least three ways to view “actual size” or “100%”. You need to pick the one that matches what exactly you’re trying to preview, in what medium. Having three ways is confusing for sure!

     

    The menu command View > 100% only means 1:1, or one image pixel to one screen pixel. So 100% means “real world size” only for digital video editing, or for any use where one pixel will be mapped exactly to one display panel pixel. So, 100% does not preview “real world size” for print! Also, 100% may not preview at “real world size” on HiDPI/Retina displays, for images destined for web design/app UI design where a “pixel” means a device-independent/UI pixel (not a display panel pixel). 

     

    The menu command View > Actual Size should preview the “real world size” (or close to it) for an image in print, if the image pixels per inch resolution is set properly in the command Image > Image Size. The Actual Size command achieves this by asking the OS about the ppi resolution of the current display, and it uses both that resolution and the resolution of the image to work out how large it would be in print. If this is what you want, you don’t need to write code for it because it’s already built into Photoshop. 

     

    The menu command View > Print Size is older than Actual Size, so it doesn’t know it can ask the OS about the display resolution. That is why Print Size can give you a ”real world size” only if you’ve entered the correct resolution values in the Photoshop command Preferences > Units & Rulers as D Fosse showed. So it’s a more difficult way to work out what Actual Size does automatically. But the nice thing is, you can use Print Size to simulate the real world size at any output resolution you like by entering the appropriate Print Resolution and Screen Resolution values (again, assuming resolution is set correctly in the image file).

    Stephen Marsh
    Community Expert
    Community Expert
    May 4, 2026

    Acrobat determines the PPI value of the monitor system value and or allows an override, which you might find useful to find the native pixel density of the monitor:

     

     

    As ​@D Fosse wrote, this is a Photoshop preference/setting and not a function of the script.

    dublove
    dubloveAuthor
    Legend
    May 3, 2026

    Oh, my God.
    My monitor's maximum resolution is only 60.

    How can I modify the code below to display the “print dimensions”?

    Thank you.

    D Fosse
    Community Expert
    Community Expert
    May 3, 2026

    60 ppi can’t be right. That’s early 1990’s, if even that. Remember, you need to measure in inches.

     

    What is the pixel resolutionof the panel? That’s in the specs. What size is it?

    D Fosse
    Community Expert
    D FosseCommunity ExpertCorrect answer
    Community Expert
    May 3, 2026

    100% in Photoshop has nothing to do with size. It means one image pixel represented by one screen pixel, 1:1.

     

    What you need to do is find the real physical ppi of your screen, by calculating screen pixels/physical measurement in inches. That’s pixel resolution as per panel spec, divided by actual measurement with a ruler.

     

    The resulting number is put into Preferences > Units and Rulers > Screen resolution. Then View > Print size should be accurate.

     

    For instance, my 27 inch 2560 x 1440 monitor is roughly 109 ppi, give or take a pixel.