Skip to main content

Posts

Showing posts from March, 2020

Replace transparency in PNG images with white background (for lots of files...)

I had to remove transparency from a PNG image file from the command line... and stack overflow came into my help[1]... But I needed it for lots of files... then, adding a "while read line" did the job: ls -1 *.png |  cut -d . -f 1 | while read line; do convert -flatten $line.png flatten/$line.png ; done; [1] Replace transparency in PNG images with white background https://stackoverflow.com/questions/2322750/replace-transparency-in-png-images-with-white-background