Remove Background & Anti Aliasing.
Posted: 2015-11-24T04:55:21-07:00
Hello
May I preface this post by stating I am extremely new to ImageMagik.
I want to batch convert a large number of .psd to .psd and .png - and remove the background to leave the background transparent in the process.
A friend who is handy at this sort of thing helped me to create this script:
#!/bin/sh
SOURCE=$1
PNG_NAME=$(basename $SOURCE .psd)
echo "Converting $SOURCE..."
mkdir ../converted_images > /dev/null 2>&1
convert -background transparent "$SOURCE" -flatten ../converted_images/$SOURCE
convert -background transparent "$SOURCE" -flatten ../converted_images/$PNG_NAME.png
The issue is with anti-aliasing - the resultant images have jaggedy edges around the object.
If anyone could repost this script with suggested changes in the script I would really appreciate it - I am still not at a level where I would know where to put the extra commands.
Again - I haver only been learning this stuff for a few weeks now so please excuse any glaring inconstancies - we all have to start somewhere! Many thanks in advance.
Using Terminal in OSX. Have installed Brew and ImageMagick:
Version: ImageMagick 6.9.2-6 Q16 x86_64 2015-11-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
May I preface this post by stating I am extremely new to ImageMagik.
I want to batch convert a large number of .psd to .psd and .png - and remove the background to leave the background transparent in the process.
A friend who is handy at this sort of thing helped me to create this script:
#!/bin/sh
SOURCE=$1
PNG_NAME=$(basename $SOURCE .psd)
echo "Converting $SOURCE..."
mkdir ../converted_images > /dev/null 2>&1
convert -background transparent "$SOURCE" -flatten ../converted_images/$SOURCE
convert -background transparent "$SOURCE" -flatten ../converted_images/$PNG_NAME.png
The issue is with anti-aliasing - the resultant images have jaggedy edges around the object.
If anyone could repost this script with suggested changes in the script I would really appreciate it - I am still not at a level where I would know where to put the extra commands.
Again - I haver only been learning this stuff for a few weeks now so please excuse any glaring inconstancies - we all have to start somewhere! Many thanks in advance.
Using Terminal in OSX. Have installed Brew and ImageMagick:
Version: ImageMagick 6.9.2-6 Q16 x86_64 2015-11-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib