"Toon" script problem only with some images
Posted: 2017-06-09T15:36:24-07:00
I clarify I use PHP (exec) and the ImageMagick version I'm using is: 6,7,8,9 (from "LIB_VERSION_NUMBER").
First of all, I save the picture from a URL with PHP. This is ok.
Then, I execute:
This is ok too, the picture is getting resized successfully.
Then, I execute the code from Toon script (thanks to Fred for these amazing scripts).
With some pictures it is working really great, but with this image: http://i.imgur.com/vg4tzQW.jpg ImageMagick is not saving the file, but I don't think that's Imagemagick fault, because with other images it works well, for example:
A curious thing is that, in the second step, when I change the resize width to less or equal than 591, it magically works, and I get this:
http://i.imgur.com/LvGVySo.jpg
That's the desired result!
I'm using the method 2 of the script, like this (I use PHP variables):
This is the "verbose info" of both images, if it helps:
With IM 6,7,8,9
So, why is this happening? And how to avoid it? I could set the resize width to 591, but is that going to work with all images?
Thanks in advance for the help, and thanks to Fred for the scripts.
First of all, I save the picture from a URL with PHP. This is ok.
Then, I execute:
Code: Select all
convert picture.jpg -resize 600 picture.jpg
Then, I execute the code from Toon script (thanks to Fred for these amazing scripts).
With some pictures it is working really great, but with this image: http://i.imgur.com/vg4tzQW.jpg ImageMagick is not saving the file, but I don't think that's Imagemagick fault, because with other images it works well, for example:
- Input: https://scontent.flim5-1.fna.fbcdn.net/ ... e=59D6D3C1
- Output: http://i.imgur.com/JjD4ih4.jpg
A curious thing is that, in the second step, when I change the resize width to less or equal than 591, it magically works, and I get this:
http://i.imgur.com/LvGVySo.jpg
That's the desired result!
I'm using the method 2 of the script, like this (I use PHP variables):
Code: Select all
"convert {$tmpA1} \( -clone 0 -blur 0x{$blur} \) \( -clone 0 -fill black -colorize 100 \) \( -clone 0 -define convolve:scale='!' -define morphology:compose=Lighten -morphology Convolve 'Sobel:>' -negate -evaluate pow {$gain} -negate -level {$smoothing}x100% \) -delete 0 -compose over -composite {$modulating} picture_new.jpg"
With IM 6,7,8,9
With IM 7my friend's family: https://pastebin.com/embed_iframe/FiBjMY1W
leonardo di caprio: https://pastebin.com/embed_iframe/YiW7teeK
I ran the script with ImageMagick 7, and it's working there with no problems, but I have to stay with 6,7,8,9 because of the hosting company.my friend's family: https://pastebin.com/embed_iframe/NsHEt1xZ
leonardo di caprio: https://pastebin.com/embed_iframe/FABMiTA3
So, why is this happening? And how to avoid it? I could set the resize width to 591, but is that going to work with all images?
Thanks in advance for the help, and thanks to Fred for the scripts.