Page 1 of 1
fish eye
Posted: 2015-09-03T02:16:29-07:00
by leos2009
Hello world of IM!
I have a new task on enlarging lips on the pic. I'm going to use Fish eye effect, but it is to be done at a certain area of the pic, like in previous forum branch
viewtopic.php?f=1&t=28246.
Could you please tell me the algorithm? As earlier I'll send the examples of the result. Thank you in advance!
http://joxi.ru/zAN0YzBukBWgm9 region on face
Re: fish eye
Posted: 2015-09-03T08:32:16-07:00
by fmw42
You can try my script, bump, at the link below. It is just like the above effect in the link, but only uses -blur without the motion blur.
Re: fish eye
Posted: 2015-09-03T08:52:46-07:00
by leos2009
how to move from the center point(x,y) to the right place for me in your script? can i use semi-circle in your script?)
Re: fish eye
Posted: 2015-09-03T08:59:03-07:00
by fmw42
No, my script does not allow either. But you have the concept from the earlier code in the link you have above and should be able to do the same kind of thing. You just need to create a mask image where you want the changes, then blur it and composite over a gray image, then use it as a displacement map. Do not do the motion-blur.
EDIT: see above
Re: fish eye
Posted: 2015-09-05T16:06:25-07:00
by leos2009
UPD: New video with worked algoritm for fish eye in some region in image
https://youtu.be/dSAxAq7J3SY
i croped lips region from orig image and applied you script bump. then converted file pasted on the orig image top
i think that is simplest way to solve the task
Code: Select all
<?php
$xpoz = $_POST['xpoz'];
$ypoz = $_POST['ypoz'];
$radius = $_POST['radius'];
$soften = $_POST['soften'];
$dist = $_POST['dist'];
$lips = $_POST['lips'];
$filename = time().'.png';
$path_file = 'files/'.$filename;
$convert = '/opt/local/bin/convert'; //path to IM for MAC OS (#type -a convert)
$myfile = 'files/lady.jpg';
//...previous code for eye brows up....
exec($convert.' '.$path_file.' -crop 84x45+107+223 files/temp.png'.' && '.
'sh /opt/local/bin/bump -a '.$lips.' -r 30 files/temp.png files/9999.png'. ' && '.
$convert." -draw 'image Over 107,223 84,45 files/9999.png' ".$path_file." ".$path_file);
//.......
Re: fish eye
Posted: 2015-09-05T19:11:31-07:00
by fmw42
Nice work.