Works awesome Fred... Thanks so much!
I called the code in your script from a script to process all the files in a given directory as follows.
Cheers!!!
#!/bin/bash
DIR=$1
FILES=$DIR/*.png
shopt -s nullglob
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f has ...
Search found 4 matches
- 2012-05-28T09:46:05-07:00
- Forum: Users
- Topic: trim alpha but maintain center
- Replies: 9
- Views: 12077
- 2012-05-27T10:58:39-07:00
- Forum: Users
- Topic: trim alpha but maintain center
- Replies: 9
- Views: 12077
Re: trim alpha but maintain center
As the image is translucent I added the borders as an example to just show the original image size (purple) compared to the desired image size (red). Those border lines would not be there in the actual input and output images.
- 2012-05-24T16:07:19-07:00
- Forum: Users
- Topic: trim alpha but maintain center
- Replies: 9
- Views: 12077
Re: trim alpha but maintain center
The following shows an example pic. It's a 400x600 sized PNG (1px purple rectangle only there to show outer border) with a black dot in the center and some smiley faces in the mid-lower left side. The red 1px rectangle is there to just show the approximate image size I'd like the result to end up as ...
- 2012-05-23T10:47:49-07:00
- Forum: Users
- Topic: trim alpha but maintain center
- Replies: 9
- Views: 12077
trim alpha but maintain center
I would like to trim as much surrounding alpha/transparency from an image but maintain the images center point/position. The following does the trim but it's over zealous as the center position is not maintained.
convert test1.png -gravity Center -trim test1-out.png
Anyone have any tips or know if ...
convert test1.png -gravity Center -trim test1-out.png
Anyone have any tips or know if ...