Page 1 of 1

How do we mingle the photo color to background color?

Posted: 2015-04-30T04:39:49-07:00
by agriz
I saw this photo/

They have merged the photo color to sand color.
How to achieve this effect?

What is the general idea on this one?
Image

Re: How do we mingle the photo color to background color?

Posted: 2015-04-30T08:21:02-07:00
by snibgo
Probably: the image of the people in the hearts is entirely black, with varying transparency. This is given a perspective distortion, then composed over the photo of the beach.

Re: How do we mingle the photo color to background color?

Posted: 2015-05-01T10:30:49-07:00
by agriz
Apart from transparency and perspective, how do they change the image color to sand color to match it?

Re: How do we mingle the photo color to background color?

Posted: 2015-05-01T10:44:58-07:00
by snibgo
If a pixel that is black but 70% transparent is composed over a colour, the result will be a slightly dark version of that colour.

Re: How do we mingle the photo color to background color?

Posted: 2015-05-01T17:37:10-07:00
by fmw42
Perhaps you can provide your two input images (or representative examples) and some one can then process them and show you the command line for that. Also please always provide your version of IM and platform, since syntax can vary. See the very top post on the Users forum at viewtopic.php?f=1&t=9620

Re: How do we mingle the photo color to background color?

Posted: 2016-02-15T17:13:42-07:00
by vinnpro
Hi Guys, I want to do something similar. I want to merge my text with a background image of beach sand. I am able to complete somewhat following:
Image

Can someone help me to optimize it in php. Quality to achieve is bit.ly/1PFBRtS, which is created in Java.

Thanks
Vin

Re: How do we mingle the photo color to background color?

Posted: 2016-02-15T17:34:32-07:00
by fmw42
What is wrong with what you have done? Was it not in Imagemagick? If it was using Imagemagick, you can just put the command line into PHP exec() command.

Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line.

See viewtopic.php?f=1&t=9620

Re: How do we mingle the photo color to background color?

Posted: 2016-02-16T07:07:56-07:00
by vinnpro
It is ImageMagik but quality it not as good as on : bit.ly/1PFBRtS . I am using WAMP 2.5 with ImageMagik 3.6 library.

I am using following lines of command:

$picin = new Imagick($inFile);
$picin->scaleimage(800,0);
$height = $picin->getimageheight();

$draw = new ImagickDraw();
$draw->setStrokeColor("#C59157");
$draw->setStrokeFill(1);
$draw->setFillColor('#8C6A45');
$draw->setFontSize(70);
$draw->setStrokeAntialias(false);
$picin->annotateImage($draw,40,$height-50,0,$text_in);
$picin->writeImage($outFile);

Is there any other functions or commands to improve the quality and make it like provide link.

Thanks,
Vinod

Re: How do we mingle the photo color to background color?

Posted: 2016-02-16T08:38:44-07:00
by Bonzo
You are not using Imagemagick directly but going through the Imagick API.

I would say you need to distort your text to make it look like it is flat on the sand and possibly make it slightly transparent to let some of the sand texture through. You might be able to do the transparency by using a rgba colour rather than hex ones.

Re: How do we mingle the photo color to background color?

Posted: 2016-06-29T21:49:08-07:00
by agriz
snibgo wrote:If a pixel that is black but 70% transparent is composed over a colour, the result will be a slightly dark version of that colour.
I did 30% colorize and changed to gray scale
photo.png was already changed to some perspective using photoshop

beach.png ( photo.png -colorspace Gray -colorize 30% ) -gravity center -compose over -composite result.png
Image

Did not work as expected
Please advice

Re: How do we mingle the photo color to background color?

Posted: 2016-06-29T22:10:39-07:00
by fmw42
If it is not working the way you want, then please explain what you want and why it is not working.

Please always provide your input images and not just the output saying it does not work.

try

Code: Select all

convert beach.png ( photo.png -colorspace Gray ) -gravity center -compose multiply -composite result.png

Re: How do we mingle the photo color to background color?

Posted: 2016-06-30T00:52:35-07:00
by agriz
Sir, i posted the result image in the first post. I just found it in some website.
I wanted to try the effect.

I don't know how to give you input images. I just wanted to make the image looks like it was drawn on the beach sand,
Multiply is giving good result.

I will post the code and images i used after changing the perspective.

Sir, you have any idea about perspective? Do we need to make different tries? Or is there any defined procedure for different distort perspective?

Re: How do we mingle the photo color to background color?

Posted: 2016-06-30T11:00:04-07:00
by fmw42
See http://www.imagemagick.org/Usage/distorts/#perspective or on Unix system (Linux, Mac OSX or Windows with Cygwin) you can use my 3Drotate script.
I don't know how to give you input images. I just wanted to make the image looks like it was drawn on the beach sand,
Multiply is giving good result.
You can upload your input image for your example the same way you provided the output images. All I am saying is if you have some result you created and it is not working the way you want, you should always provide both the input and output images along with your command line, so that others can test with the actual images and command. And also explain why it is not working the way you want, so we can understand what is the problem.