Page 1 of 1

Blend images with gradient.

Posted: 2007-05-27T13:43:01-07:00
by dognose
Hi,

I'm trying to blend images together sorta like this:

Image

I tried the examples, and one looked really promising, but didn't work:

convert tile_aqua.jpg tile_water.jpg -size 94x94 gradient: +matte -composite water_shallows.jpg

Maybe it doesn't work on my version 6.2.8 (I've had problems getting an upgrade) Any tips on getting
this working?

Re: Blend images with gradient.

Posted: 2007-06-03T19:44:02-07:00
by anthony
There was a version where that scheme failed, you seemed to have found it!

In short the use of a masked composition is not finalized, as it only works with images that have no alpha channel to start with, and only the default 'over' composition is used. though that appears to be what you want.

Upgrade, to fix.

Re: Blend images with gradient.

Posted: 2007-06-04T20:11:16-07:00
by dognose
Boy, I wish I could upgrade to the latest version.. however, it won't even install on the latest RH release.

6.2.9 was the version I was testing it on. I can't update the server version, and the anything newer from IM won't install.

Was there a work around for the version that didn't work?

Re: Blend images with gradient.

Posted: 2007-06-04T20:43:27-07:00
by anthony
Even if you do, I don't recomend using the 3 image composite to merge two images into each other.

Better to add transparnecy to edge of one image, then overlay that image with the appropriate offsets over the enlarged area of the other image.

Re: Blend images with gradient.

Posted: 2007-06-05T13:38:53-07:00
by dognose
Well, that sounds like exactly what I'd want to do.

How would I "add transparency to edge of one image" ?

Re: Blend images with gradient.

Posted: 2007-06-05T14:23:14-07:00
by Bonzo
There is an example near the bottom of this page:
http://www.imagemagick.org/Usage/compose/

Re: Blend images with gradient.

Posted: 2007-06-05T17:58:37-07:00
by anthony
dognose wrote:How would I "add transparency to edge of one image" ?
You create a gradient image, and set that as the overlay images alpha channel.
That is actually what the 3 image blend is currently doing, though that is not what it should be doing (for overlay the current method works well, just not for other composition methods) Of course your IM is not doing either, so you need to DIY it.

Code: Select all

  compose   overlay_image.jpg mask_image.jpg \
          +matte -compose CopyOpacity -composite \
          \( background_image.jpg  ...add space for overlay image... \) \
          +swap -geometry +Xoffset+0  +compose -composite \
          save_image.jpg
You still need to create your mask, (which I think may be smaller than the image it is being added to, not sure) add space to the background image to fit the new one, if needed, and supply the Xoffset for the overlay. But that is basically it.

Re: Blend images with gradient.

Posted: 2007-06-06T13:55:19-07:00
by dognose
Great! Thank you. I'm finally getting results.

I think the command you used there was "convert" and not "compose".

Re: Blend images with gradient.

Posted: 2007-06-06T16:02:55-07:00
by anthony
Opps yes -- convert. A typo... I was thinking of compositing images!

"Bad spellers of the world, UNTIE!"