How to rotate a watermark png img at 45 degree on an jpg image?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
zxsz4084
Posts: 25
Joined: 2015-03-31T01:31:44-07:00
Authentication code: 6789

How to rotate a watermark png img at 45 degree on an jpg image?

Post by zxsz4084 »

How to rotate a watermark png img at 45 degree on a jpg image?

I have a transparent png file like " http://vi1.6rooms.com/live/chenlongtest/banquan.png " ,I will watermark it on a jpg image ,
I use command like this:
composite -gravity center banquan.png 2388.jpg 2388_bq.jpg

then the new image " http://vi1.6rooms.com/live/chenlongtest/2388_bq.jpg "。

I want to leans the "banquan.png" 45 degree on "2388.jpg", how to do ? thanks。
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to rotate a watermark png img at 45 degree on an jpg image?

Post by fmw42 »

composite is nearly deprecated and less functional that convert. See http://www.imagemagick.org/Usage/compose/#compose

try (unix syntax)

Code: Select all

convert  2388.jpg  \( banquan.png -background none -rotate XX \) -gravity center -compose over -composite banquan.png2388_bq.jpg 
windows syntax

Code: Select all

convert  2388.jpg  ( banquan.png -background none -rotate XX ) -gravity center -compose over -composite banquan.png2388_bq.jpg 
Please always provide your IM version and platform when asking questions, since syntax differs. Please read the top most post in this forum at viewtopic.php?f=2&t=20598
zxsz4084
Posts: 25
Joined: 2015-03-31T01:31:44-07:00
Authentication code: 6789

Re: How to rotate a watermark png img at 45 degree on an jpg image?

Post by zxsz4084 »

Dear fmw42 ,thank you very much , it both works well in my two versions。

-bash-3.2$ /usr/local/ImageMagick/bin/convert -version
Version: ImageMagick 7.0.1-1 Q16 x86_64 2016-05-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib fontconfig freetype jng jpeg png tiff x xml

-bash-3.2$ convert -version
Version: ImageMagick 6.2.8 05/07/12 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Post Reply