Page 1 of 1

Jpg with round corner and white background

Posted: 2007-10-05T06:52:38-07:00
by YvesTan
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)

Re: Jpg with round corner and white background

Posted: 2007-10-05T14:23:41-07:00
by Bonzo
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.

Re: Jpg with round corner and white background

Posted: 2007-10-05T23:33:42-07:00
by YvesTan
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 !

Re: Jpg with round corner and white background

Posted: 2007-10-09T21:56:52-07:00
by anthony
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