How to see dimensions as mm and pixels at the same time

JM
Posted By
Jani_M_Ylinen
Jan 5, 2009
Views
1676
Replies
6
Status
Closed
Hi

Is there a way or a plugin how i can see marquee rectangle size in both mm and pixels at the same time. I need both information constantly and it is very annoying to always go to INFO / Palette options to switch witch way i want to see the measurements.

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

P
PShock
Jan 5, 2009
I don’t think there’s a way to see different measurement units simultaneously, but an easier way to change them is by right clicking on the ruler and choosing from the contextual menu that appears.

-phil
CP
christoph_pfaffenbichler
Jan 5, 2009
I concur to the unlikelihood of simultaneous readouts.
But if You don’t need the measurements to live-update it should probably be fairly easy to create a Script that displays both measurements on invocation.
JM
Jani_M_Ylinen
Jan 5, 2009
The right click on ruler is easy enough. Good to know!

Thanks
CP
christoph_pfaffenbichler
Jan 5, 2009
No one asked for it, yet here it is:

// shows width and height of a selction in pixels and mm;

#target photoshop;

if (app.documents.length == 0) {

alert ("No open document")}

else {

var myDocument = app.activeDocument

//function hasSelection(doc) by xbytor;

var res = false;

var as = myDocument.activeHistoryState;

myDocument.selection.deselect();

if (as != myDocument.activeHistoryState) {

res = true;

myDocument.activeHistoryState = as;

};

if (res != true) {

alert ("No selection active")}

else {

var theSelection = myDocument.selection;

var originalUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

var theBounds = theSelection.bounds;

var theWidth = (theBounds[2] – theBounds[0]);

var theHeight = (theBounds[3] – theBounds[1]);

preferences.rulerUnits = Units.MM;

theBounds = theSelection.bounds;

var theMmWidth = round ((theBounds[2] – theBounds[0]), 1);

var theMmHeight = round ((theBounds[3] – theBounds[1]), 1);

alert ("The Selection measures \r" + theWidth+ " by " + theHeight + "\r" + theMmWidth + " mm by " + theMmHeight + " mm")

Preferences.rulerUnits = originalUnits

}

}

//round the values, thanks to bob stucky;

function round ( number, precision ) {

var number = parseFloat( number );

var precision = parseInt( precision );

if ( precision == 0 ) {

return Math.round( number );

}

return Math.round( number * Math.pow( 10, precision ) ) / Math.pow( 10, precision );

}

One could assign it a shortcut in Edit – Keyboard Shortcuts.
JM
J_Maloney
Jan 5, 2009
10 pixels/cm ppi?
CP
christoph_pfaffenbichler
Jan 5, 2009
Case-sensitivity can be such a … source of errors when one is sloppy. »Preferences.rulerUnits = originalUnits« in line 30 should be »preferences.rulerUnits = originalUnits«; sorry.
Does that work better?

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections