hi, sorry if i'm asking to much this days.
i have already solve the problem of make a pdf in multiple steps this is a really fun lib
i have another question, there is a way to make a horizontal blur and a vertical blur?, i mean the -blur make a blur but from center, i want to make a left to right blur, or a up to down blur.
Thanks for reading, and thanks for the solution
horizontal and vertical blur?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: horizontal and vertical blur?
-motion-blur should be what you want, but it may not be working correctly. Give it a try, but if it does not work to your satisfaction then you need to compose a filter using -convolve. Here is an example of a horizontal blur 15 pixels wide:
filt15="\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
"
convert inputimage -convolve $filt15 outputimage
filt15="\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
"
convert inputimage -convolve $filt15 outputimage
Re: horizontal and vertical blur?
i try to make that command but it give me a malloc problem
convert prueba.jpg_2 -convolve $filt15 salida.jpg
*** glibc detected *** convert: malloc(): memory corruption: 0x08207a70 ***
i don't know what could be
convert prueba.jpg_2 -convolve $filt15 salida.jpg
*** glibc detected *** convert: malloc(): memory corruption: 0x08207a70 ***
i don't know what could be
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: horizontal and vertical blur?
I am not sure. You may not have enough memory? But try taking out all the backslashes and make the filt15 variable definition all one long line. Be sure not to remove any commas or the quotes.
If you are on Windows, you may need to use double backslashes \\ (escape the backslash as that is a special character on Windows) or remove them.
If you are on Windows, you may need to use double backslashes \\ (escape the backslash as that is a special character on Windows) or remove them.
Re: horizontal and vertical blur?
Not quite sure what the effect is supposed to be but this created an image for me using php on a windows XP machine.
The original post didn't work neither did changing the \ to \\
Code: Select all
<?php
$filt15 = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,";
exec("convert print2.jpg -convolve $filt15 blur.png");
?>
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: horizontal and vertical blur?
It is supposed to create the equivalent of a 1D horizontal blur of 15 pixels using a uniform convolution kernel. IM -convolve cannot handle 1D, non-square or even kernels. This is the equivalent of a proper motion blur as a camera would see it. IM has -motion-blur, but it is not symmetric nor does it have uniform weights, but is 1D.
The filter as I created it with the continuation backslashes works fine in Unix. But I am afraid that \ is not a continuation character in Windows. Thus the need to remove them all.
Even though IM -convolve requires square filters, they have to be expressed as one long comma delimited string. The \ for continuation was just a convenience to make it look like it is 2D.
The filter as I created it with the continuation backslashes works fine in Unix. But I am afraid that \ is not a continuation character in Windows. Thus the need to remove them all.
Even though IM -convolve requires square filters, they have to be expressed as one long comma delimited string. The \ for continuation was just a convenience to make it look like it is 2D.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: horizontal and vertical blur?
If you don't mind it being exact.
Do two motion blurs, one in each direction, and then average those two images together. I do this for creating 'star' rays in
http://imagemagick.org/Usage/advanced/#stars
Though I repeat it at multiple angles.
Do two motion blurs, one in each direction, and then average those two images together. I do this for creating 'star' rays in
http://imagemagick.org/Usage/advanced/#stars
Though I repeat it at multiple angles.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/