I am having trouble to cut photos in the command line. I need to cut transparent part of a photo and save with command line or shell script Thanks beforehand. If I could do it I would apply it for 4000 photos and it would be a great help More clear explanation what I want to do I have a png picture like this enter image description here
I want to have an image like this
enter image description here
I could make the image transparent only and is there any way to cut bottom transparent part from a png file
Beforehand thank you very much
It's hard without seeing your images, but you can try with ImageMagick as follows:
convert input.png -trim +repage output.png
and see if that works. If it nearly works, try:
convert input.png -fuzz 25% -trim +repage output.png
If it works, make a backup and then do them all with GNU Parallel:
find . -name \*.png -print0 | parallel -0 mogrify -trim +repage {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With