Using transparent on the command line
Posted: 2009-12-05T14:08:21-07:00
I am trying to create square images by making a border on images and then cropping.
Here is the command I've been trying to get to work:
convert original.jpg -bordercolor "#e6a7c8" -transparent "#e6a7c8" -thumbnail 57x57 -gravity center -format jpg -border 60x60 -crop 57x57+0+0 new.jpg
It does everything I want it to do except to change the color #e6a7c8 to clear.
I tried -opaque in conjunction with -fill as well. No go. I also tried doing the
convert above first without the -transparent part, and then a 2nd convert as:
convert -transparent "#e6a7c8" new.jpg new.jpg
but that didn't work either.
I looked into -alpha, but my version of convert doesn't have that. Nor does it
have the -transparent-color option. I also tried setting -background colors.
Setting the color itself to "transparent" makes the color black.
I have this version:
Version: ImageMagick 6.0.7 07/25/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2004 ImageMagick Studio LLC
Any suggestions on how to get a transparent border color when I create
square images?
Thanks!
David
Here is the command I've been trying to get to work:
convert original.jpg -bordercolor "#e6a7c8" -transparent "#e6a7c8" -thumbnail 57x57 -gravity center -format jpg -border 60x60 -crop 57x57+0+0 new.jpg
It does everything I want it to do except to change the color #e6a7c8 to clear.
I tried -opaque in conjunction with -fill as well. No go. I also tried doing the
convert above first without the -transparent part, and then a 2nd convert as:
convert -transparent "#e6a7c8" new.jpg new.jpg
but that didn't work either.
I looked into -alpha, but my version of convert doesn't have that. Nor does it
have the -transparent-color option. I also tried setting -background colors.
Setting the color itself to "transparent" makes the color black.
I have this version:
Version: ImageMagick 6.0.7 07/25/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2004 ImageMagick Studio LLC
Any suggestions on how to get a transparent border color when I create
square images?
Thanks!
David