Opaquing the translucent
convert input.png -fill "#3171b5" -opaque none output.jpg
Where #3171b5 is a colour.
Background:
I realised that the header image on my journal was 200kb big. Now we may all have fat pipes these days but there’s still no excuse for a 200kb decoration. Until lossy PNGs appear, I’m just going to have to use a JPEG. What this means, though is that I’ll have to abandon the nice transparent corners.
So, imagemagick to the rescue. How to replace the transparent bits with the colour of my journal’s background? (See above :−) The result is a less obese 44kb.