Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Cropping an image to a layer.

    I'm no Photoshop user, except in a very mundane sense, so this is a very straightforward question.

    Imagine I have a PSD with a document size of 500x500 pixels.

    It has one layer, upon which sits a green square 50 pixels on each size and sitting at (250, 300).

    What I want from this document is a PNG, a 50 pixel green square.

    How do I go about this?

    I know this is simplistic -it's just an example. I essentially want a crop to the content of a layer. I'm using CS6.
    IP

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    36,694

    Default Re: Cropping an image to a layer.

    The simple answer is do it in Xara. It is so much easier.

    I created a page to your size. Added a green square. Selected the square via the Magic Wand tool and cut it to the clipboard.

    I created a new page and specified the background color transparent. Then pasted in place.

    I'm sure I did this the hard way but I only use Photoshop as a pass through filter.
    Attached Images Attached Images
    Gary W. Priester
    Mr. Moderator Emeritus Dude
    , Sir

    gwpriester.com | Custom-Stereograms.com | eyeTricks on Facebook





    IP

  3. #3
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Re: Cropping an image to a layer.

    I might ( would ) agree it's easier using Xara, but I wanted to know the technique to use with just Photoshop!

    I can accomplish the task, but there has to be an easier way than I can do it now.

    One of the things that's frustrating about Photoshop is that while I can select the layer and the square, Photoshop won't even say how big it is.

    Thanks for the heads-up.
    IP

  4. #4
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    36,694

    Default Re: Cropping an image to a layer.

    You could layout and create the image in Xara, export it as a bitmap, and then edit the bitmap in Photoshop.
    Gary W. Priester
    Mr. Moderator Emeritus Dude
    , Sir

    gwpriester.com | Custom-Stereograms.com | eyeTricks on Facebook





    IP

  5. #5
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Re: Cropping an image to a layer.

    Gary, this is all about Photoshop - Xara specifically excluded!

    The starting point here is an image sitting on a layer in photoshop, displaced from the origin, and the objective is to create a PNG of just that image, cropped to fit.

    I am not creating the image, someone else is giving it to me.
    IP

  6. #6

    Default Re: Cropping an image to a layer.

    Quote Originally Posted by pauland View Post
    ...Imagine I have
    1. a PSD with a document size of 500x500 pixels.
    2. It has one layer, upon which sits a green square 50 pixels on each size and sitting at (250, 300).
    3. What I want from this document is a PNG, a 50 pixel green square.

    I know this is simplistic -it's just an example.
    Yeah, the problem with "simplistic" is that (almost) any example I can think of won't likely fit what it is you are really needing.

    Screen shot should be self-explanatory. But, just in case, all I did (other than try to recreate your example) was to use the magic wand, inverse the selection, copy to the clipboard and then hit ctrl+n to create a new document. Depending upon the preferences setting, you can see in the screen shot the new document is being made at the clipboard content size, which is your 50 px X 50 px. Then paste it into the new document.

    See? A too simple answer for a simplistic question!
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled-2.jpg 
Views:	215 
Size:	108.8 KB 
ID:	99304  
    IP

  7. #7
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Re: Cropping an image to a layer.

    OK, Mike and Gary, thanks for your patience with me and this dumb question.

    The thing that particularly caused me to stumble was that when selecting a layer, the content is shown as selected by photoshop, but the actual size of the selection was not, so I was left wondering how big that selection was. My Doh! moment in particular was not using the selection tool specifically to select what was there and then have the actual size revealed.

    It seems counter-intuitive to me that selecting a layer never reveals the size of the content on the layer ( unless I'm missing another trick ).

    I did discover ( on my photoshop journey ), that selecting a layer, then duplicating it allows the layer to be duplicated into a completely new document or another open document, as-is so that's a great feature.

    Generally as a new user I find photoshop quite clunky, but that's because I only use it for fairly simple things as part of a pipeline, rather than as an asset/art creator in it's own right.

    Thanks Guys. Job done.
    IP

  8. #8
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Re: Cropping an image to a layer.

    Whilst we're on this subject - here's my real example - a UI element.

    How can I tell it's exact XY position? Photoshop tells me how big the selection is, but not the position. That seems bizarre to me.

    I can move the cursor to the corner of the selection - the cursor XY is always shown.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screen Shot 2013-11-01 at 12.36.49.png 
Views:	208 
Size:	26.8 KB 
ID:	99307  
    IP

  9. #9

    Default Re: Cropping an image to a layer.

    You can show the rulers, making sure it is displaying in pixels (right-click on the ruler for the units). You can then make sure the 0,0 is in the upper left (double-click where they join).

    You can always check a layer's dims by right-clicking on the image's title bar or tab, choose the appropriate action in the context menu. The X/Y will show only the current position. So if you want to display say something's X/Y at the top left, drag rulers into place.

    Personally, I have never understood using PS for UI development. But it is heavily used, that's for certain. I cannot remember if Fireworks shows X/Y positions, but I used it for UIs back in the early 2000s. Before that couple year stint, I used CorelDraw for UI development, as well as afterwards. If you are subscribed, FW CS6 might be downloadable. I would check it out if so.

    Mike
    IP

  10. #10
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    7,958

    Default Re: Cropping an image to a layer.

    Thanks Mike.

    My clients supply me their designs in PSD or AI format generally. It would be nice to know precisely, without any eyeballing, where a particular element has been positioned.

    I think the easiest way I have found is to do an extreme zoom in to a corner and position the mouse. At high zoom I can get the position reliably. It seems a kludge though.
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •