Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
If you don't use "-fuzz", then "-trim" will do nothing to edges that have different pixels. Your edges in th second image have different pixels -- they are mostly transparent white, but the top-left and bottom-right pixels are not.
You can either fix those pixels, or use "-fuzz 11%" etc.
snibgo wrote: ↑2019-01-24T06:09:02-07:00
If you don't use "-fuzz", then "-trim" will do nothing to edges that have different pixels. Your edges in th second image have different pixels -- they are mostly transparent white, but the top-left and bottom-right pixels are not.
You can either fix those pixels, or use "-fuzz 11%" etc.
Yep - the northwest and southeast corners are marked.
fuzz values from 1%-100% weren't working for me so I made some modifications by painting the corners mentioned:
If you have plenty of room all around, you can just shave some number of pixels from all sides. Then if needed use -border to add back the same number of pixels of the background color.
Alternately, put a 1 pixel border around the image of the background color, do a transparent fuzzy flood fill and extract the alpha channel. Then use either -morphology or -connected-components to clean the alpha channel for small specks. Then shave off the one pixel and put the processed image back into the alpha channel of your input.