mac sips program seems to ignore --padColor option

1.2k Views Asked by At

I have a 128x256 png file I am trying to pad to 512x512 with sips but sips always seems to pad with transparency rather than the specified padColor. What am I doing wrong?

sips junk-128x256.png --padToHeightWidth 512 512 --padColor 00FF00 --out junk-512x512.png

The resulting image is 512x512 but with transparent padding.

1

There are 1 best solutions below

0
On

The sips command will only pad with color for jpg and bmp file formats. Other file types are always padded with white. In order to add a colored padding to a png file, first convert to bmp and then pad and convert back to png.

sips junk.png -s format bmp --out junk.bmp
sips junk.bmp -s format png --padToHeightWidth 512 512 --padColor 00FF00 --out junk-512x512.png