Smooth edges after background removal
Posted: 2014-04-03T14:26:16-07:00
Hi everyone. I got great help before and I'm in need of a little bit more. This is the current script I call via PHP to remove a white background image and convert the remaining image to a single color.
It works but the removal of the background image leaves jagged edges. Is there a way I can smooth out the edges? Here is an example image below.
original
converted
Code: Select all
exec('convert '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimage.' -quality 100 '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimageNoExt.'c.png');
exec('convert '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimageNoExt.'c.png -fuzz 23% -transparent white '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimageNoExt.'t.png');
exec('convert '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimageNoExt.'t.png \
\( -clone 0 -fuzz 99% -fill gray18 -opaque red -write '.WP_PLUGIN_DIR.'/fancy-product-designer/'.$fimageNoExt.'g.png \) \
null: 2>&1', $a);
original
converted