2

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.

Glenn
  • 1,996
  • 2
  • 24
  • 32

1 Answers1

5

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
Glenn
  • 1,996
  • 2
  • 24
  • 32