Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
YvesTan
Post
by YvesTan » 2007-10-05T06:52:38-07:00
Hello,
I try to generate photos thumbnails jpg with white background. I use this command :
Code: Select all
convert -size 100x100 xc:none -draw 'roundRectangle 0,0 100,100 15,15' -fill white original.jpg -compose SrcIn -composite thumbnail.jpg
But I dont understand why it's not working (I obtain black corner).
It's great with png out but the image is too bigger ! 40 Ko for 100x100 simple png...
Thanks !
YvesTan (french user)
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2007-10-05T14:23:41-07:00
I do not know if this is a valid way to use ImageMagick and I could not get all the code on one line:
Code: Select all
composite -compose Dst_in ( convert -size 100x100 xc:none -fill black -draw "roundRectangle 0,0 100,100 15,15" ) house.jpg -matte thumbnail.png
convert -size 100x100 xc:white thumbnail.png -composite output.jpg
Your black corners are still comming from the transparency.
YvesTan
Post
by YvesTan » 2007-10-05T23:33:42-07:00
Thanks to your answer. I've use a similar way with 2 command line.
The first on my previous post and
Code: Select all
convert thumbnail.png -background white -flatten thumbnail_out.jpg
And after "rm thumbnail.png"
Bye !
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2007-10-09T21:56:52-07:00
while flatten will not work with mogrify for in-place image modification, (it is a multi-image layers operator after all. an alturnative is border.
mogrify -bordercolor white -border 0x0 thumbnail.png