Page 2 of 3

Re: Copy color from source image

Posted: 2012-01-08T22:52:12-07:00
by agriz
I am now trying with different images.
-brightness-contrast -40,30 -- I think, this is the keyword and important to merge the images.

I will upload what i got for different images.

Re: Copy color from source image

Posted: 2012-01-08T23:00:39-07:00
by fmw42
agriz wrote:I am now trying with different images.
-brightness-contrast -40,30 -- I think, this is the keyword and important to merge the images.

I will upload what i got for different images.

-brightness-contrast does not affect merging images, all it does is change how bright or how much contrast you have in your background image.


See my other examples that followed without the -brightness-contrast. Tell me what it is that you want to do that is different from any or all of my examples above.


What is your current php command?

Re: Copy color from source image

Posted: 2012-01-08T23:05:15-07:00
by agriz
second example is just merging.
I want the first example.

If i upload my photo, then, it should be merged with that poster and should look like little old poster

Re: Copy color from source image

Posted: 2012-01-08T23:08:35-07:00
by fmw42
agriz wrote:second example is just merging.
I want the first example.

If i upload my photo, then, it should be merged with that poster and should look like little old poster

Are you getting what you want now? If not, what is your current command?


see
http://www.imagemagick.org/script/comma ... s-contrast
http://www.imagemagick.org/Usage/color_mods/
http://www.imagemagick.org/Usage/layers/#convert

Re: Copy color from source image

Posted: 2012-01-08T23:14:38-07:00
by agriz
First example is working for few images.
For some other images, i am not exactly getting the result.

I will try this now "-sigmoidal-contrast 10,50%"

Re: Copy color from source image

Posted: 2012-01-08T23:25:58-07:00
by anthony
Starting at basics....

You mentioned you have a color photo you want to make look like it matches the old poster.

Hmmm I would look at the poster and try to work out the average darkest (text), and lightest (background) color and use that as as tinting gradent for a black and white version of the photo.

Re: Copy color from source image

Posted: 2012-02-10T06:04:04-07:00
by agriz
Image

This is my exact need.
I was trying lot. But This picture explains what i am exactly looking.
I want to replace the photo in the heart.

Another one is

Image
I want to composite a photo in the middle of the heart, But the photo should mingle with the heart's color.

Image
This is not correct. Because the photo is not mingled with the original image.

Image
This one is good. it is mingled with the original photo.

Re: Copy color from source image

Posted: 2012-02-10T12:45:08-07:00
by fmw42
You need to create a feathered alpha channel on the overlay image before compositing. Post a link to your two separate input images that you want to combine and we can show you how to do that.

Below I cropped the girl image from your composite, then did the following:


convert zmy23k.png hva0p0_crop.png \
\( -clone 1 -fill white -colorize 100% -virtual-pixel black -blur 0x20 -auto-level -level 50x100% \) \
\( -clone 1 -clone 2 -alpha off -compose copy_opacity -composite \) \
-delete 1,2 -gravity center -geometry +0-30 -compose over -composite zmy23k_hva0p0_comp.png

Image


You can adjust the blur amount from 20 to some other value to get different vignetting effects.

Re: Copy color from source image

Posted: 2012-02-10T17:54:35-07:00
by agriz
I tried your script.
But it didn't work

That is the right image.
That girl image can be anything.

I tried this code

Code: Select all

/usr/bin/convert zmy23k.png hva0p0_crop.jpg \( -clone 1 -fill white -colorize 100% -virtual-pixel black -blur 0x20 -auto-level -level 50x100% \) \( -clone 1 -clone 2 -alpha off -compose copy_opacity -composite \) -delete 1,2 -gravity center -geometry +0-30 -compose over -composite zmy23k_hva0p0_comp.png
I used an jpg image instead of that png
I am using imagemagick version 6.7.4-0 (This is windows)

@6.5.4-7 (This is linux)
I got this following error.
unrecognized option `-auto-level'

Re: Copy color from source image

Posted: 2012-02-10T18:19:50-07:00
by fmw42
Your linux version of IM is too old for -auto-level. Replace it with -contrast-stretch 0

Also windows syntax is different. You must remove the \ with the parens and change % to %%. Also the end of line \ needs to be changed to ^

see
http://www.imagemagick.org/Usage/windows/

Re: Copy color from source image

Posted: 2012-02-10T18:43:12-07:00
by agriz
I used yum install ImageMagick on my fedora.
How to get the latest version?

Re: Copy color from source image

Posted: 2012-02-10T18:46:54-07:00
by magick
Try this:

Re: Copy color from source image

Posted: 2012-02-10T19:06:55-07:00
by agriz
Will it install in the /usr/bin/ ?
Or do i need to configure the path during the install?

Re: Copy color from source image

Posted: 2012-02-11T07:39:26-07:00
by magick
By default it installs in /usr/local.

Re: Copy color from source image

Posted: 2012-02-12T07:27:57-07:00
by anthony
I recommend a package install of IM under fedora -- I do this all the time...
Packages make it cleaner to install and upgrade.

See my notes in..
http://www.imagemagick.org/Usage/api/#rpms

However if you want a non-system (personal) version, look at the section further down
http://www.imagemagick.org/Usage/api/#personal

A have 3 'personal' versions I pick an choose from as part of my development work.
Personal versions does not interfere with other programs that may use ImageMagick. (such as the "Calibre" E-book reader)