Drop shadow on watermark image
Drop shadow on watermark image
Hi, I'm trying to add a drop shadow to an image overlayed on another image.
---
This is almost what I want, but the image in the center needs a drop shadow:
/usr/bin/convert 'sample.png' -resize 1000x750! -resize 854x641! -crop 854x480+0+80! -modulate 50 -blur 0x10 -gravity None 'sample.png' -geometry 586.66666666667x440+133.66666666667+20 -compose src-over -composite -density 72 -units PixelsPerInch -quality 75 'sample1-nodropshadow.png'
https://www.dropbox.com/s/78qayx4g8ld8e ... w.png?dl=0
---
This is close, kind of, but obviously the full color image needs to be on top of the drop shadow...
/usr/bin/convert 'sample.png' -resize 1000x750! -resize 854x641! -crop 854x480+0+80! -modulate 50 -blur 0x10 -gravity None 'sample.png' -geometry 586.66666666667x440+133.66666666667+20 \( +clone -background black -shadow 50x10+5+5 \) +swap -compose src-over -composite -density 72 -units PixelsPerInch -quality 75 'sample10-ghost.png'
https://www.dropbox.com/s/03un5m79frj3m ... t.png?dl=0
---
What do I need???
Thanks much!!
---
This is almost what I want, but the image in the center needs a drop shadow:
/usr/bin/convert 'sample.png' -resize 1000x750! -resize 854x641! -crop 854x480+0+80! -modulate 50 -blur 0x10 -gravity None 'sample.png' -geometry 586.66666666667x440+133.66666666667+20 -compose src-over -composite -density 72 -units PixelsPerInch -quality 75 'sample1-nodropshadow.png'
https://www.dropbox.com/s/78qayx4g8ld8e ... w.png?dl=0
---
This is close, kind of, but obviously the full color image needs to be on top of the drop shadow...
/usr/bin/convert 'sample.png' -resize 1000x750! -resize 854x641! -crop 854x480+0+80! -modulate 50 -blur 0x10 -gravity None 'sample.png' -geometry 586.66666666667x440+133.66666666667+20 \( +clone -background black -shadow 50x10+5+5 \) +swap -compose src-over -composite -density 72 -units PixelsPerInch -quality 75 'sample10-ghost.png'
https://www.dropbox.com/s/03un5m79frj3m ... t.png?dl=0
---
What do I need???
Thanks much!!
Re: Drop shadow on watermark image
Thanks, but I have looked all over the documentation and I just can't figure out the order to put it in my command... I'm generating the whole image with just one image.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
Post your input images to some place such as dropbox.com and put the URLs here. Then we can try to give you the code to do the processing. What is your IM version and platform, since syntax may differ.
Re: Drop shadow on watermark image
Sample image is from drupal
https://www.dropbox.com/s/tdl170zkose57 ... e.png?dl=0
ImageMagick 6.6.9-7 2016-11-29 Q16 on Linux
https://www.dropbox.com/s/tdl170zkose57 ... e.png?dl=0
ImageMagick 6.6.9-7 2016-11-29 Q16 on Linux
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
You cannot add a shadow to an image that already is merged. You need to upload both the background image and the foreground image that is to have a drop shadow.
Re: Drop shadow on watermark image
How would I add a shadow to the center image PRIOR to merging it with the background?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
see the link that I referenced earlier. http://www.imagemagick.org/Usage/blur/#shadow
Re: Drop shadow on watermark image
I understand how to do a shadow... but how do I combine it with the commands I have listed above to make a shadow on the center image before merging with the background??
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
That is why I asked you to provide both your input images, so I can send you a command that works. I do not want to try to analyze your command, since I have no way to test my suggestions.
Re: Drop shadow on watermark image
It is with one image. If you look at the examples in the first post, you can see what I'm trying to accomplish.
In english, here are the steps I am taking on ONE image:
// resize original to fit 1000x1000
// blur
// darken
// crop to 854x480
// place original to fit 814x440 at center
In english, here are the steps I am taking on ONE image:
// resize original to fit 1000x1000
// blur
// darken
// crop to 854x480
// place original to fit 814x440 at center
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
It is late here. So I will work on this tomorrow for you, unless some one else on the forum wants to tackle it first. That is OK with me.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
OK. So try this:
Is this what you want?
Code: Select all
convert sample.png \
\( -clone 0 -resize 1000x1000 -modulate 50 -blur 0x10 -gravity center -crop 854x480+0+0 +repage \) \
\( -clone 0 -resize 814x440 \) \
\( +clone -background black -shadow 80x3+5+5 \) \
\( -clone 3 -clone 2 -background none -layers merge +repage \) \
-delete 0,2,3 -gravity center -compose over -composite sample_result.png
Is this what you want?
Re: Drop shadow on watermark image
Drop shadows seem to be broken in 7.0.4-5 (OS X Sierra, installed via homebrew).
The command from the previous post, with the same sample image generates the result shown below.
Note how the main image is transparent, not solid, and the shadow offset and borders are wrong.
The command from the previous post, with the same sample image generates the result shown below.
Code: Select all
convert sample.png \
\( -clone 0 -resize 1000x1000 -modulate 50 -blur 0x10 -gravity center -crop 854x480+0+0 +repage \) \
\( -clone 0 -resize 814x440 \) \
\( +clone -background black -shadow 80x3+5+5 \) \
\( -clone 3 -clone 2 -background none -layers merge +repage \) \
-delete 0,2,3 -gravity center -compose over -composite sample_result.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Drop shadow on watermark image
Looks like a bug in -layers merge. I have reported it. See viewtopic.php?f=3&t=31282