I have been struggling with this for some time now.
convert -background white -size 165x70 label:'this is a test' label_size_fit.jpeg
composite -compose Copy label_size_fit.jpeg -background white -gravity East -geometry +200-100 -density 350 test.pdf output.pdf
This all looks great except that there is a dark grey background on my label_size_fit.jpeg only after it composes onto the pdf?
Have tried multiple files.. jpeg, .png, .svg (that one showed up completely black) for my label_size_fit.jpeg
How can I make this a transparent .png, and be sure it will stay transparent when composing with a pdf?
(Solved) Transparent Image
(Solved) Transparent Image
Last edited by jmituzas on 2011-02-22T13:43:21-07:00, edited 1 time in total.
(Solved) Transparent Image
Ok this worked
convert -transparent white -size 165x70 label:'this is a test' label_size_fit.png
composite label_size_fit.png -gravity East -geometry +200-100 -density 350 test.pdf output.pdf
Yay I'm getting somewhere.
This app is great!
convert -transparent white -size 165x70 label:'this is a test' label_size_fit.png
composite label_size_fit.png -gravity East -geometry +200-100 -density 350 test.pdf output.pdf
Yay I'm getting somewhere.
This app is great!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: (Solved) Transparent Image
Using -transparent is not a good solution.
try setting -background none or -background transparent
In this case I did not have an example of this in the actual 'text to image' area of IM Examples (my bad)
http://www.imagemagick.org/Usage/text/
or in more complex text handling (compound fonts)
http://www.imagemagick.org/Usage/fonts/
Though I do use transparent backgrounds a lot in many other examples thought IM Examples.
try setting -background none or -background transparent
Code: Select all
convert -background transparent -size 165x70 label:'this is a test' label_size_fit.png
http://www.imagemagick.org/Usage/text/
or in more complex text handling (compound fonts)
http://www.imagemagick.org/Usage/fonts/
Though I do use transparent backgrounds a lot in many other examples thought IM Examples.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/