Page 1 of 1

Request help in generating circular image with transparency...

Posted: 2019-09-20T09:37:55-07:00
by timindaburgh
I've made attempts to generate an image, but can't seem to make it happen. I want a word with white lettering in a dark colored circle. Outside the circle should be transparent and the text in the circle should not be transparent. Each time I try to make the image transparent, the word becomes transparent too. I want the word to remain opaque, otherwise it works against me when trying to place the image over another image or picture.

The nuance is that edges of the words in white would go beyond the edge of the circle. Therefore, a mask would be needed to chop off the edges of the words that extend beyond the perimeter of the circle.

The image I'm trying to generate would be the YSI logo shown in the header of the following site: pacamp.ysi.org

I have tried the following command to generate the logo (image):

Code: Select all

convert -size 400x400 xc:transparent \
          -draw "fill blue  circle 200,200 200,0 \
                 font Times-Bold  font-size 310 \
                 fill white \
                 translate 45,300 text 0,0 'ysi'" \
          -flatten ysi_logo.png
When I upload the ysi_logo.png file to the header, you can see the white area that surrounds the logo - and I want those areas to be transparent.

Thanks in advance.

Re: Request help in generating circular image with transparency...

Posted: 2019-09-20T10:09:42-07:00
by snibgo
Why do you "-flatten" the image? I think you don't want that.

Re: Request help in generating circular image with transparency...

Posted: 2019-09-20T10:10:15-07:00
by fmw42
Either remove the -flatten or add -background transparent before -flatten

Re: Request help in generating circular image with transparency...

Posted: 2019-09-20T10:42:35-07:00
by timindaburgh
fmw42, I've added -background transparent just before -flatten. However, there is still a portion of the letters "y" and "i" that are not being cropped. Thus, I think some kind of mask will need to crop them off. The desired logo should look like the one at ysi.org.

Thanks for your quick responses fmw42 & snibgo.