Copy link to clipboard
Copied
Hey you guys,
I have a question that has to do with pasting an object from one canvas onto another. This applies to Photoshop or Illustrator.
Let's say I have a canvas/artboard setup at 1000px tall by 500px wide, at 72ppi. I also have another canvas setup in the exact opposite dimensions, 1000px wide and 500px tall. Now let's say I have a logo graphic (created inside of the program) that I scale to a certain size and place in the bottom-right corner of the canvas. If I copy and paste this logo (or simply drag it) into the second canvas, the one that is 1000px wide by 500px tall, the logo graphic will suddenly appear larger than it does in the first canvas. Even if both canvasses/artboards are set to the same zoom level. Does this have something to do with the more "landscape" orientation of the second canvas, whereas the first canvas has a more "portrait" orientation?
Can anyone please explain or speak on why this is? Thank you for your help, it is greatly appreciated!
Copy link to clipboard
Copied
I posted a script the can place a Logo/Watermark on any reasonable size image. You will not be able to paste your logo into a icon or small thumbnails size image and be able to see your logo well. You just need to change the Code to use your logo not mine.
The first few vars statements need to be changed for your preferences. The script resizes the logo to be some percentage of your documents height. You use the var statements to set the height percentage, margin percentage, location and logo file.
Here is Photoshop Script PlaceWatermark.jsx
/* ==========================================================
// 2017 John J. McAssey (JJMack)
// ======================================================= */
// This script is supplied as is. It is provided as freeware.
// The author accepts no liability for any problems arising from its use.
/*
<javascriptresource>
<about>$$$/JavaScripts/PlaceWatermark/About=JJMack's PlaceWatermark ^r^rCopyright 2017 Mouseprints.net^r^rPhotoshop Script^rCustomize using first four var</about>
<category>JJMack's Script</category>
<enableinfo>true</enableinfo>
</javascriptresource>
*/
#target photoshop;
app.bringToFront();
var logoFile = "~/Desktop/JJMack.png"; // Watermark file should be large for resize down works better than up
var LogoSize = 10; // percent of document height to resize Watermark to
var LogoMargin = 1; // percent of Document height the Watermark should have as a margin
var BottomLetf = false; // false = Bottom Right true Bottom Left
//placeWatermark(logoFile, LogoSize, LogoMargin); // Place Watermark into the bottom of the document
if (documents.length) app.activeDocument.suspendHistory('placeWatermark','placeWatermark(logoFile,LogoSize,LogoMargin)' );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function placeWatermark(Image,Size,Margin){
if(!documents.length) return; // if no document return
var fileObj = new File(Image); // the passed file
if(!fileObj.exists){ // If file does not exits tell user
alert(fileObj.name + " does not exist!"); // Alert User
return; // return
}
try{
var doc = app.activeDocument; // set Doc object to active document
app.displayDialogs = DialogModes.NO; // Dialog off
var strtRulerUnits = app.preferences.rulerUnits; // Save Users ruler units
var strtTypeUnits = app.preferences.typeUnits; // Save Users Type units
app.preferences.rulerUnits = Units.PIXELS; // work with pixels
app.preferences.typeUnits = TypeUnits.PIXELS; // work with pixels
var layers = app.activeDocument.layers; // get layers
app.activeDocument.activeLayer = layers[0]; // Target Top Layer
placeFile(fileObj); // Place in file the Watermark png file
activeDocument.activeLayer.resize(100 ,100,AnchorPosition.MIDDLECENTER); // Insure Place did not scale layer
var SB = activeDocument.activeLayer.bounds; // get layers bounds
var layerHeight = SB[3] - SB[1]; // get layers height
var resizePercent = (100/layerHeight)*(Size/100*doc.height.value); // Percent to resize by
activeDocument.activeLayer.resize(resizePercent ,resizePercent,AnchorPosition.MIDDLECENTER); // Resize width and height by percentage
SB = activeDocument.activeLayer.bounds; // get resized layers bounds
activeDocument.activeLayer.translate(-SB[0].value,-SB[1].value); // Move resized layer to top left canvas corner
var LayerWidth = (SB[2].value - SB[0].value); // get resized layers width
var LayerHeight = (SB[3].value - SB[1].value); // get resized layers height
marginSize = Margin/100*doc.height.value; // Margin size
// move resized watermark into the document lower right corner with some margin or lower left
if ( BottomLetf) {activeDocument.activeLayer.translate(marginSize,( doc.height.value -marginSize - LayerHeight));}
else {activeDocument.activeLayer.translate((doc.width.value -marginSize - LayerWidth),( doc.height.value -marginSize - LayerHeight));}
}
catch(e) { alert(e + ': on line ' + e.line); } // inform user of error
finally{
app.preferences.rulerUnits = strtRulerUnits; // Restore user ruler units
app.preferences.typeUnits = strtTypeUnits; // Restore user type units
};
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function placeFile(placeFile) {
var desc21 = new ActionDescriptor();
desc21.putPath( charIDToTypeID('null'), new File(placeFile) );
desc21.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );
var desc22 = new ActionDescriptor();
desc22.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 );
desc22.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 );
desc21.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc22 );
executeAction( charIDToTypeID('Plc '), desc21, DialogModes.NO );
};
Copy link to clipboard
Copied
Hello JJMack,
Thank you so much for replying so quickly to my question! Thank you for the script!
Caruso
Copy link to clipboard
Copied
Maybe I'm missing something, but if the files are the same resolution and magnification, dragging from one window to another should maintain the same visual size. In the animation below, the magnification, pixel dimensions and resolution are visible on the status bar of both windows (bottom left). The cat looks the same size to me, and if I check the Info panel, they are the same size. What am I missing?
BTW, I tend to drag and drop to copy between windows, but got the same result with copy/paste.
~Barb
Copy link to clipboard
Copied
Hi! Thank you so much for your quick response to my question. Yes, in your example they clearly look the same. However, I have noticed some kind of phenomenon where my logo will visually look "larger" when placed onto another canvas, even despite the info panel indicating it is the same size.
If you open up Illustrator, create two empty artboards, one that is 1000px tall and 500px wide, and then another with the opposite dimensions. Now draw out a small rectangle. Paste this rectangle into the artboard with the larger width. You should notice that visually the rectangle appears to occupy more space than in the other window.
If
Copy link to clipboard
Copied
Here is the same sequence in Illustrator...again, I don't see a difference.
~Barb
Copy link to clipboard
Copied
Copy-Paste function will copy pixels without any thought of resolution. Copied object must be exactly the same in pixel dimensions regardless of difference in resolution. This function was working this way for years. Same should be true when copy-paste layer from one document to another or when dragging it.
I am testing Ps 21.2.3 on Windows and everything works as described above.
Copy link to clipboard
Copied
In Photoshop, the resolution is a undoubtedly a factor. In Illustrator, it is not.
If it is happening in both, I suspect it is a visual illusion. I set up both tests using the exact same specs, and took care to line up the floating windows to eliminate it.
Let's say I have a canvas/artboard setup at 1000px tall by 500px wide, at 72ppi. I also have another canvas setup in the exact opposite dimensions, 1000px wide and 500px tall.
In the original post, the resolution is specified for the first window, but not the the second. As stated in my posts, I made sure both windows in both applications had only one difference—the orientation.
~Barb