How to rotate and overlay

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?".
Post Reply
dmafackler

Re: How to rotate and overlay

Post by dmafackler »

Not tested, but perhaps a lead to follow:

composite -compose atop -geometry 150x150+13+17 \
rose-0.jpg -rotate 45 -transparent-color white \
rose.jpg \
overlay3.jpg

composite -compose atop -geometry 150x150+13+17 \
rose-0.jpg -rotate 45 -transparent-color transparent \
rose.jpg \
overlay3.jpg


Sources:

http://www.imagemagick.org/script/comma ... php#rotate
indicates background color can be set to take care of the corners.

Composite has a "-transparent-color" option.

identify -list color
shows named color definitions as shipped with ImageMagick.

white = rgb(255,255,255)
Identified as an 8-bit/channel triplet.

transparent = rgba(0,0,0,1)
Uses alpha (aka matte, mask) channel
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to rotate and overlay

Post by anthony »

Actually if you had read IM Examples, set "-matte -background none" before the rotate!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply