Mobile app version of vmapp.org
Login or Join
Moriarity648

: Fit non-transparent part of an image in photoshop I have a bunch of images that I want to re-size to make icons with. I have found these images on Google and they are all 512*512 images

@Moriarity648

Posted in: #AdobePhotoshop

I have a bunch of images that I want to re-size to make icons with.

I have found these images on Google and they are all 512*512 images but the spacing between the actual image (the non transparent part of the image) and the border of the image is not the same for every one of those images.

The thing is that I want to make all of them fit into 70% of the image, while excluding the transparent pixels and allowing semi-transparent pixels (the image shadow) to exceed this 70% limit.

I have tried to trim the image and then re-size it but I don't get the result that I want because the shadow is either truncated or it is included inside of the 75% perimeter.

Here is an image which explains the issue :


Could you please tell me how to proceed ?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Moriarity648

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Trim all images' shadows
Resize all images to the same size
Make a Master file with:


Desired final size
Desired shadow

Combine the images that you want with the master file so the images will be on the top layer and the shadow layer in the back.
Now all the images will have same size and shadow.

10% popularity Vote Up Vote Down


 

@Gail6891361

I'll give you a outline of what I would do.

First I would convince my client that this is a bad idea. But given that you probably have that covered; You wouldn't care anyway. People never do, untill they realize that scaling icons is never really a good idea.

Next I would consider something other than PS as this is one of those things where tools like, python, perl or Imagemagick may be better. If this wont do then i would consider photoshop scripting. The outline of the script would look as follows:


Select your transparency:


Save channel.
Run treshold on that.

Read the size of tresholded image:


Load selection.
Fill a new layer.
Querry new layer position plus height and width. No theres no rasy direct way to do this.

Padd with empty pixels where needed and crop.


Be prepared for 10-20% of images where this will fail.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme