Adding a background color to a transparent image

adding-background-color-to-png.png

For a previous article, linear regression and least square method, I generated a few PNG images using inkscape. Those images had a transparent background, and when I tried to add them to the dark themed version of the blog, it was impossible to distinguishing anything.

In GNU/Linux, it is possible to use the command line interface to add a color. Here the recipe:

magick image-transparent.png -background white -alpha remove -alpha off image-white.png

Date: 2025-12-22 Mon 14:53

Author: Oscar Castillo-Felisola

Created: 2025-12-27 Sat 07:34