When I am trying to convert a series of images from RGBA .eps to png and maintain the source file name. I am getting a black outline on output png. And I am not sure what is causing this.
The command that I am using is below:
convert -density 300 -colorspace RGB "C:\Users\Matt\Logos\*.eps" -background transparent -gravity center -scale 600x600 -extent 600x600 -set filename:original %t -colors 256 %[filename:original].png
Everything else seems to be working fine, but I am left with this strange barely visible boarder.
Any idea on whats causing this or how to fix it would be greatly appreciated.
Here are the output files:
http://imgur.com/a/klQ3C
Thanks!
Converting EPS to PNG leaving black boarder around png
Re: Converting EPS to PNG leaving black boarder around png
ImageMagick 7.0.3-0 Q16 x64Bonzo wrote:And your IM version is?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting EPS to PNG leaving black boarder around png
Can you provide your input EPS file? We cannot test your command without it. Also what is your platform (presumed Windows from your syntax)? Please always provide your IM version and platform with any questions, since syntax may vary.
P.S. Why are you using linear RGB. That would make the image darker. You should be using -colorspace sRGB with current versions of IM.
The "border" around the figure is aliasing probably from the scaling. You would need to extract the alpha channel and blur it a bit to antialias the border edges of your figure. -scale is rather coarse. Perhaps you should try -resize.
P.S. Why are you using linear RGB. That would make the image darker. You should be using -colorspace sRGB with current versions of IM.
The "border" around the figure is aliasing probably from the scaling. You would need to extract the alpha channel and blur it a bit to antialias the border edges of your figure. -scale is rather coarse. Perhaps you should try -resize.
Re: Converting EPS to PNG leaving black boarder around png
Thanks for the response fmw42
Here is the link to one of the eps files I am trying to convert https://we.tl/uhixSjOCvw
Sorry for not providing my IM Version and platform. I'm running it on Windows 7 and ImageMagick 7.0.3-0 Q16 x64
So I tried the resize command vs the scale command and it seemed to help although the black border is still there. The sRGB vs RGB input definitely helped the color output. I was wondering what was going on there.
I will try to figure out how to extract the alpha channel and blur it slightly to get ride of that black border. Haven't tried this before so if anyone could point me in the right drirection many thanks!
Here is the link to one of the eps files I am trying to convert https://we.tl/uhixSjOCvw
Sorry for not providing my IM Version and platform. I'm running it on Windows 7 and ImageMagick 7.0.3-0 Q16 x64
So I tried the resize command vs the scale command and it seemed to help although the black border is still there. The sRGB vs RGB input definitely helped the color output. I was wondering what was going on there.
I will try to figure out how to extract the alpha channel and blur it slightly to get ride of that black border. Haven't tried this before so if anyone could point me in the right drirection many thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting EPS to PNG leaving black boarder around png
For a single image (windows syntax, I think), try
Try also -blur 0x1. See which looks better. You can also change the 50 in -level 50x100%.
Code: Select all
magick -density 300 -colorspace sRGB 130.eps ^
-background transparent -gravity center -resize 600x600 -extent 600x600 ^
( +clone -alpha extract -blur 0x0.5 -level 50x100% ) ^
-alpha off -compose copy_opacity -composite ^
-set filename:original "%t" -colors 256 "%[filename:original]_3.png"
Re: Converting EPS to PNG leaving black boarder around png
Thanks fmw42, this works great for individual images, but what would I need change to convert a whole batch of eps files? Just changing the format to *.eps extension doesnt seem to do the trick.
Any advice or something I'm missing here?
magick -density 300 -colorspace sRGB "C:\Users\Maddox\Logos\*.eps" -background transparent -gravity center -resize 600x600 -extent 600x600 ( +clone -alpha extract -blur 0x0.5 -level 50x100% ) -alpha off -compose copy_opacity -composite -set filename:original "%t" -colors 256 [filename:original].png"
Thanks again
Any advice or something I'm missing here?
magick -density 300 -colorspace sRGB "C:\Users\Maddox\Logos\*.eps" -background transparent -gravity center -resize 600x600 -extent 600x600 ( +clone -alpha extract -blur 0x0.5 -level 50x100% ) -alpha off -compose copy_opacity -composite -set filename:original "%t" -colors 256 [filename:original].png"
Thanks again
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting EPS to PNG leaving black boarder around png
You could try mogrify, but I am not sure it handles parenthesis processing. If not, then you will have to write a script loop over each eps image.