Bulk trim transparent pixels !!! only on two sides of the image !!! #6982
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The first image you posted has only one flashlight. There is no way to trim any parts of it without trimming its sides and making it smaller. Please post an example where there is a region that can be trimmed as you describe. I do not see how one can trim the area you marked in your second image with a green check mark without making the image smaller vertically nor keeping is vertical positioning. Are you ok with vertical modifications, but just want the horizontals to be preserved? So in the top image, you want to trim the top and bottom transparent regions, but not the sides? Is that correct? The solution for that case image, only would be to splice a one pixel color column to one side and trim, then do the same to the other side and trim. See https://imagemagick.org/Usage/crop/#trim_oneside Input:
The input has dimension of 302 × 1054 and the output has dimensions of 302 × 44. The above works for Imagemagick 7 by changing convert to magick. On Imagemagick 7, you can also do
and get the same result. This does not work for internal transparent regions between multiple opaque regions. |
Beta Was this translation helpful? Give feedback.
The first image you posted has only one flashlight. There is no way to trim any parts of it without trimming its sides and making it smaller. Please post an example where there is a region that can be trimmed as you describe.
I do not see how one can trim the area you marked in your second image with a green check mark without making the image smaller vertically nor keeping is vertical positioning.
Are you ok with vertical modifications, but just want the horizontals to be preserved? So in the top image, you want to trim the top and bottom transparent regions, but not the sides? Is that correct?
The solution for that case image, only would be to splice a one pixel color column to one side…