Resize canvas as a percentage of the width of a layer?

Hello

Is it possible to resize a canvas so that it is exactly 120% the area of selection? Or maybe 120% of the width of a layer?

We have a lot of .psd files that have significant margins. I need to reduce them so that they have 10% of the height of the content as the margins on all sides, but each document is different width and height. So I need to select the content of the document, increase this area selected by 20% vertical (somehow) and then change width/height the title of the document so that only 10% of margin all around.

Thank you

Here is a clean script.  This script works only with version newer than CS2 Photoshop so that it uses the app.activeDocument.suspendHistory () method. to suspend the States in the history of Photoshop.  This method has been added to Photoshop scripts after CS2.  The script can be run with CS2 by simply using main();  It take time to learn how Photoshop works and how changes over time as updates are always added.  Know how Photoshop will allow you to record best actions and writing script that work well.

if (documents.length < 1) alert("No Open Document!");
else app.activeDocument.suspendHistory('Add Border', 'main()');

function main(){
  var startRulerUnits = app.preferences.rulerUnits;
  app.preferences.rulerUnits = Units.PIXELS;
  var borderSize = (Math.max(app.activeDocument.height,app.activeDocument.width)/100) * 10;
  app.activeDocument.resizeCanvas((app.activeDocument.width + (borderSize*2)), (app.activeDocument.height + (borderSize*2)), AnchorPosition.MIDDLECENTER);
  app.preferences.rulerUnits = startRulerUnits;
}

Photoshop is a complex application and because of it how this script will work depends on layers in the active document and the current background color in Photoshop.   Photoshop supports a special layer called the background layer.  A document is not required to have a background layer.   Only the background layer in the layer stack can be a the "Background" layer for any of the layers can be underneath.  'Background' of Photoshop layer supports transparency its still partially locked for all pixels in a background opacity is 100% and the layer is the same size as the canvas size documents.  If you change a document the size of the canvas and the document contains a background layer that layer background size will also change.  The background can be cropped and enlarged.  When developed the added pixels will be the current background color in Photoshop.  So the added border can be any color or empty pixels. For documents are not required to have a background layer.  Other layer types support transparency as well as their size will not be changed. Basemap layers not can be any size and have a report l / h and have an alignment onto canvas documents. Him are anchored the outlines and the acts of canvas size as a clipping to the composite image mask.   When the new canvas is added to that alignment of the canvas can change this controlled anchor position is used for the canvas resize operation.  A border that is added to a document can not be empty or a solid color for the old canvas size might have pixels of clipping in some layers that are now is more cut and show in the composite.

Tags: Photoshop

Similar Questions

  • Setting the width and the height of the elements (texts, images), with custom percentages associated with the width of the browser

    Dear Muse-Geeks,

    I'm really pleased with the ability and especially the ease use of Muse. But I couldn't imagine that the width of a text box, image, the box cannot be defined as a percentage of the width of the browser.

    But now after some research on the web I really seems the only option is the 100% browser width.

    I just missed something to set a value in percentage (vertical/horizontal) size?

    Concerning

    André

    Hi Woods

    When you talk about the size of objects as a % of the browser, I think you are talking about the responsiveness of the site. If Yes, then it is not possible to create sensitive sites in Muse at the moment. But yes, you can set the width to 100% for some items and a slide show full-screen only.

    Kind regards

    Aish

  • percentages vertical positioning depends on the width of the block?

    I seem to have found a problem when firefox is positioning of blocks based on the values of percentage margin offsets

    In short, look at this page: http://akos.maroy.hu/~akos/frontend/experiment/awake.html

    the desired size of the image section is 75% of the available area, also well vertically than horizontally. the planned place of the section of the image is so, it is in the Middle, vertically and horizontally.

    If it works horizontally, it seems that the vertical position of the image depends on the horizontal width of the window. If you change the width of the window, the image will move vertically.

    It is not exclusive to Firefox. Your problem is that uses margin-top '%' to mean '% of the width.
    http://www.w3schools.com/cssref/pr_margin-top.asp

  • How to resize an image using PIXELS to define the width and height?

    I need make my image a certain number of pixels wide and high.  When I resize image I can't change the area that shows the pixels of width and height, and when I drop down lists it does not give option pixels.  When I choose "points" and "Pica" they are obviously not other names for the pixels because the given number is not the number of pixels above.  I used to be able to do it EASILY in elements 2.0, my previous version of elements.  I am now using 8.0.

    In fact, I just realized that nothing that I in image resize will change the number of pixels at ALL in question.  Size and pixel per inch are locked permanently in relationship to each other.  I had to download a new version not long because my computer hard drive has failed, and I think they changed the things that work so not now, because I would have noticed it before now if it's that way when I downloaded originally from that.  I begin to fear that I'll have to kludge with the crop tool, even if the resizing of the image SHOULD be able to.

    Make sure resample is checked:

  • fluid grid appears as his means to chrome and firefox, but in ie and safari the divs to display as a percentage of the entire screen, rather than as a percentage of the maximum width

    fluid grid appears as his means to chrome and firefox, but in ie and safari the divs to display as a percentage of the entire screen, rather than as a percentage of the maximum width

    I found the problem, thank you! nothing just a missing brace in the css that was causing the problem. the lines of code are numbered, and red when there is a problem (in cc at least 15). I could be the last to know that.

  • Muse cut the part left my site when resizing the window of the browser for anything whether it is less than the width of the page

    When you use centering nychtemerales, Muse cut the left side of my site when re the sizing of the window of the browser for anything less than the width of the page, this also happens on mobile devices.  How can I keep the page focused but have content basically left stop when resizing or viewing on a mobile screen? I don't want the edge of the page to disappear on smaller screens and when you use a smaller window. I do not want to resize the entire site at a lower resolution. Thanks in advancearbubaproblem.jpg

    If the left is cut, then you have designed offshore from the left of the page mode Design of Muse. The blue guides indicate the edge of the page and a margin guide on the page. Rule zero is the left edge of the page.

    The page is not admissible it will focus as long that the browser is wider than the page. Then, she left aligned (on point zero on the sovereign in design mode).

  • How to resize the width of the region

    Hi all

    I use apex 4.2.2 database oracle 11g R2, IE 9.

    I created a region on the HOME tab to the navigation menu.
    but its width is covering the width of the entire page.
    How could resize the width of the navigation region?

    Thank you very much.

    Hi Maahjoor,

    Change the region and

    In the Region attributes set style = ' width: 300px; " instead of 300, you can put all desired widths.

    hope this helps you.

    Kind regards
    Jitendra

  • Resize canvas applescript using the relative tick?

    I use this

    say application "Adobe Photoshop CS6.

    Resize canvas height -1 anchor top center

    end say

    I want to reduce the size of 1 pixel high image at the Center. But when I do it manually, I would use the "relative" checkbox

    How can I do this?

    Please

    say application "Adobe Photoshop CS5.

    say document 1

    resize the canvas (height - 1) top of the anchor position

    end say

    end say

  • Doubling the width of the canvas actually triple width

    Hello

    I'm having a problem where I create a white border images of the landscape around two oriented that are the same size then double the width of the canvas.  I've never had this problem before with PS CS6 and it drives me crazy... I tried to reset the workspace of photography but no luck.  I tried with pictures of portrait oriented two and the same result.  I rebooted my machine.  I'm on Windows 7 Pro 64 bit and I use PS CS6 64-bit as well.  Thought about doing a repair through programs and features, but it has only the option uninstall.  I did not anything out of the ordinary except for use a action a few days before I downloaded and used from http://www.photoshopsos.com/ and I downloaded and used the printing press action.

    Does anyone have ideas how I can fix this?  If an image is 20 inches wide and I'm doubly it at 40 it is triple the width to 60 inches.  Is there a way I can reset all aspects of PS CS6 to return to a State of plant other than unintalling and reinstalling?

    "Are you using Image > canvas size and have the" Relative "-checked?

  • How reduce/resize the width of the objects (AIArtHandle) via the API?

    Hi all

    I want to know how can I resize the width / length of s?

    I went through the API and got some useful suite as AITransformArtSuite. But I'm unable to use its TransformArt method. given that I don't know how to create the appropriate AIRealMatrix.

    Please show me how to do it.

    Thank you

    D.A.

    Hello

    I use the AITransformArtSuite like this:

    Matrix AIRealMatrix;

    Linda ScaleX, ScaleY;

    AIArtHandle MyArt.

    sMath-> AIRealMatrixSetIdentity (& matrix);

    ScaleX = 0.5;

    ScaleY = 0.5;

    sMath-> AIRealMatrixSetScale (& matrix, ScaleX, ScaleY);

    error = sAITransformArt-> TransformArt (MyArt, & matrix, 1.0, kTransformObjects);

    For me, it works.

    JLG.

  • Resize a line without changing the width?

    Hello

    I am new to Flash/AS, so please, be gentle.

    I created a line (on the scene) where height is 10px, and the width is 2px. To resize, I converted to a symbol (MovieClip) and given an instance (let's say li ).

    However, when I get home...

    li.height = 200;
    

    ... or resize the MovieClip with the mouse, the line is 200px height, but it has also increased substantially thicker!

    However, if I go to the clip, click on the picture and resize it here, I have the line stays slim and beautiful.

    How to solve this dilemma? Can I access the object of drawing with a special 'trick' or draw the object with as in the first place (but how?)?

    There must be a way to do it, I would be very happy if someone could tell me which would be the best way (I want to resize each image line, so a solution AS would be preferable).

    Thanks in advance!

    If you select the line and look in the properties panel, you should see a selection of scale.  Choose None

  • How to resize the width of the table programmatically?

    Hello

    I have a table with a change number of columns dynamically. Is it possible to set the width of the entire table and change the width of the columns by program? Something like property activates a cell: size: width of the listbox?

    Thanks in advance.

    Errata:

    There is a possible way to change the size of the elements; See this KB for this request.

    hope this helps,

    Norbefrt

  • How to resize controls to get the width

    Hi guys,.

    I will try to find a way to not hard code the width/height of the controls, checked a way to use 'USE_ALL_WIDTH' of bb4, but the DockLayout method, but the solution in this thread will not work, because I can not find DockLayoutProperties:

    is there properties such as USE_ALL_WIDTH or USE_ALL_HEIGHT

    So, how do you guys do when you need a control to get all the width of the screen size?

    Hello

    Suppose you want to give the width of button do as below:

    Container {
            layout: DockLayout {
            }
            Button {
                id: submitButton
                text: "Submit"
                onClicked: {
                }
    
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
            }
        }
    

    Do not include horizontalAlignment: HorizontalAlignment.Fill inside layoutproperty.

    Thank you

  • How can I make the width of the cell fixed by percentage in a table?

    I have a table in a grid of liquid, which I would like "width" to be fixed cells [I want to the height to increase when I put the text in the cell, but not the width]. Here's the html code:

    < table width = "95%" border = "1" >

    < b >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < /tr >

    < /table >

    Thanks in advance

    You could give an id to the table, and then target the th of the table tags to give them heights VH (% of the height of the viewport) on the css. Something like...

    In the html code...

    In the css...

    {#mytable}

    Width: 95%;

    }

    #mytable th {}

    min-height: 50vh; / * 50% of the height of the viewport but can to be more important if the content wants more * /.

    }

    Height in css works a little differently than you expect. Using a right unit % will make the element this height % of the adjustment of the height of the parent element. If there is no parameter in the parent, the child setting is ignored. In my example, I use the vh unit based on the height of the viewport for the minimum height of the element. In this way, if the content ends up needing more space that otherwise, would be available, it will not "come out" of the container. Instead, the container will expand to contain the content or be 50% of the height of the current window, if it is larger.

    It works very well in the modern browser, but is ignored in what anyone lower than IE9.

    There are probably better ways to do what you want, without the aid of a table.

  • Resize the width of the mode live view for resets overview sensitive to the top of the page

    Almost every time I move the scrubber in live view to verify sensitive breakpoints are correct, it scrolls by me to the top of the page.

    Unfortunately, it's a problem for the sites of scrolling a page, as the question that I am trying to fix is a path down a long page, and the only way to see the responsiveness in action is to zoom stupidly far. Y at - it an option to enable the circumvention of this off, or reasonable?

    Edit: I use Mac OS on a MacBook Pro 10.10.4

    MrJW gave you a good work around in Live View mode.  But honestly, when I work with the reagents long pages, I saw in the browsers and keep them open while I do a few code tweaks.  Then refresh browser (F5 or Ctrl + R) to check my progress.  I almost never work without one or several browsers open at all times.

    Right click > inspect element is another feature of good browser to use.

    If you have Firefox with the Web Developer Toolbar extension, you can use Resize > sensitive view layouts to see the appearance of your page (s) on multiple devices.  This is a handy feature.

    In addition, you can edit the CSS in real-time to see how it effects your work and lots of other good things.

    I highly recommend the FF Web Developer Toolbar.  It's free. I use mine constantly.

    Web Developer: Modules for Firefox

    Nancy O.

Maybe you are looking for