Resize, nudge upwards and apply partial gradient

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
Win7
Posts: 4
Joined: 2013-11-13T08:12:18-07:00
Authentication code: 6789

Resize, nudge upwards and apply partial gradient

Post by Win7 »

Hi I would like to crop and resize an image, nudge it upward (north) 25 pixels, then apply a black-to-transparent gradient starting 25 pixels from the bottom and fading upward 30 pixels.

Example of final output:

Image

I already have the crop and resize part working, and would like to add on the other steps:

Code: Select all

convert.exe OrigFile -resize 800 -gravity south -crop 800x533+0+0 +repage OutputFile1
Would appreciate your help.

Thank you.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resize, nudge upwards and apply partial gradient

Post by snibgo »

... a black-to-transparent gradient starting 25 pixels from the bottom and fading upward 30 pixels.
You could build this in three pieces, then compose that over the input.

Code: Select all

convert -size 800x30 gradient: -gravity South -extent 800x478 -gravity North -background Black -extent 800x533 ( -clone 0 -negate ) -compose CopyOpacity -composite g.png
(There may be a better way.)
nudge it upward (north) 25 pixels
What does that mean? Do you want to trim 25 pixels from the top?
snibgo's IM pages: im.snibgo.com
Win7
Posts: 4
Joined: 2013-11-13T08:12:18-07:00
Authentication code: 6789

Re: Resize, nudge upwards and apply partial gradient

Post by Win7 »

Hi snibgo, thanks, I will test it out.
Post Reply