Drop shadow or fade function in Magick++

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
lavenderx311
Posts: 2
Joined: 2015-08-03T18:51:08-07:00
Authentication code: 1151

Drop shadow or fade function in Magick++

Post by lavenderx311 »

I'm writing in C++ for ImageMagick 6.9.1-10 and am desperately needing a drop shadow function for my images. Magick++ only has a shadow function (which only makes the entire image a shadow of itself). Right now, I've copied my image, placed it behind my original, and added the shadow function to it. However it still seems very harsh. Does anyone have help with this? Perhaps an effect that would blend my self-made shadow with the background? Thanks.

This is the image: http://postimg.org/image/tolu48ujb/
I want it to look something like this: http://postimg.org/image/y6x8icwv7/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Drop shadow or fade function in Magick++

Post by fmw42 »

Try this (unix syntax)

Code: Select all

convert 162.png  \
\( -clone 0 -background black -shadow 80x3+5+5 \) \
+swap -background none -layers merge +repage result.png

(you did not tell us your platform)

same command as at http://www.imagemagick.org/Usage/blur/#shadow, but you have transparency in the image, so it will get a shadow.

The result image will be bigger than the input due to the added external shadow. So you may want to crop the image to its original size.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Drop shadow or fade function in Magick++

Post by fmw42 »

lavenderx311 wrote:Sorry wrong photo.
Before: http://postimg.org/image/ki4bqyidr/
After: http://postimg.org/image/y6x8icwv7/

I am using Magick++ on Xcode, so i can't use the given code.
Then you will need to ask on the Magick++ forum about the same command. I have moved some of the posts in Users to your post here and delete your whole post on Users.
Post Reply