Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I know how to trim an image in Photoshop. (choose Image > Trim in Photoshop's menu)

Is there any method to trim a slice to get rid of extra transparent space?

share|improve this question
    
You might want to look into this: graphicdesign.stackexchange.com/questions/20705/… –  Joonas Sep 3 '13 at 5:49
add comment

1 Answer

Not an answer, but I don't have the rep for a comment yet.

What I do is hide all other layers that aren't part of the slice. Then I add (or enable) a background layer with a different color from the edges of the slice (usually white, black or red). Then I zoom in as far as I can and use the color picker to find where the fade stops and the solid background color begins, and put a guide there. This gets tricky if you have an oddly-shaped graphic that you're trying to slice, where you have to find the most extreme pixel along any given edge. Then it's either 'slices from guides' or re-adjusting the edges of the slice to line up with the guides manually. Then turn off that background layer before I save that slice with transparency.

I suppose another method would be to slice your images roughly, not caring about the exact pixels, then saving the images with transparency. Re-open the images and trim transparent pixels and re-save.

I'd definitely be interested in finding a better way, as this is laborious, time-consuming and error-prone.

share|improve this answer
    
Thanks for the background layer trick, are there any plugins or scripts can solve this problem? –  clyfish Sep 4 '13 at 3:05
    
Now I use imagemagick's trim operator to speed up the slicing. First, export the slice to png, then convert slice.png -trim info:, then adjust the X/Y/W/H of the slice and export again. –  clyfish Sep 10 '13 at 8:19
    
I create a photoshop script which uses imagemagick to trim the slice automatically. Github: github.com/clyfish/slicetrim –  clyfish Sep 24 '13 at 5:23
    
Nice looking script, I'll have to give it a try, cause I tend to do a LOT of slicing. –  beercodebeer Sep 24 '13 at 13:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.