Odd aliasing behavior - doesn't happen with separate files
Posted: 2008-08-20T14:38:52-07:00
All,
I'm trying to automatically generate a page header image that simulates a top-of-page tab. Eventually I want to be able to conveniently alter colors and regenerate it.
I first used convert.exe in discreet steps to create the pieces and then combine them. This works great. (see goodheader.pngbelow).
But I really would prefer to combine it all into a single invocation of convert without using temporary files. If I do so, I get a slightly different result -- look at the right edge of the tab, and you can see ugly aliasing apparently leftover from the mask.
I think I probably need to adjust the -alpha on|off|... setting somewhere in the process, but I've tried everything I can think of.
My batch file is listed below. My results may temporarily be viewed at:
http://keveney.com/test/test.html
I'm using version 6.4.2 08/14/08.
Any advice?
Should I post this as a bug?
-Matt
---- My Windows batch file -----
rem make header image
rem
rem faint gradient background
rem 'convex' gradient nav bar
rem
rem Mask for the tab
rem
rem (I think the fill color should not be relevant here, since were' only going to use the
rem alpha channel in subsequent operations. I make it blue so I can easily see it in testing.)
rem
convert^
-size 900x100^
xc:none^
-draw "fill blue stroke-width 0 path 'M 0,100 0,75 600,75 C 620,75 630,100 650,100 Z'"^
mask.png
rem Gradient for background
rem
convert^
-size 900x100^
gradient:#FFF-#FDD^
backgradient.png
rem Gradient for tab itself
rem
convert^
-size 700x25^
gradient:#F88-#F00^
tabgradient.png
rem Create cutout in background
rem
convert^
backgradient.png^
mask.png^
-alpha on^
-compose dst_out^
-composite^
cutout.png
rem Create header from files (this works great!)
rem
convert^
-gravity southwest^
cutout.png^
tabgradient.png^
-compose dst_over^
-composite^
goodheader.png
rem Do it all in one step. (This gives weird aliasing on right edge of tab!)
rem
convert^
-size 900x100^
gradient:#FFF-#FDD^
^
xc:none^
-draw "fill blue stroke-width 0 path 'M 0,100 0,75 600,75 C 620,75 630,100 650,100 Z'"^
-alpha on^
-compose dst_out^
-composite^
^
-size 700x25^
gradient:#F88-#F00^
-gravity southwest^
-compose dst_over^
-composite^
^
badheader.png
I'm trying to automatically generate a page header image that simulates a top-of-page tab. Eventually I want to be able to conveniently alter colors and regenerate it.
I first used convert.exe in discreet steps to create the pieces and then combine them. This works great. (see goodheader.pngbelow).
But I really would prefer to combine it all into a single invocation of convert without using temporary files. If I do so, I get a slightly different result -- look at the right edge of the tab, and you can see ugly aliasing apparently leftover from the mask.
I think I probably need to adjust the -alpha on|off|... setting somewhere in the process, but I've tried everything I can think of.
My batch file is listed below. My results may temporarily be viewed at:
http://keveney.com/test/test.html
I'm using version 6.4.2 08/14/08.
Any advice?
Should I post this as a bug?
-Matt
---- My Windows batch file -----
rem make header image
rem
rem faint gradient background
rem 'convex' gradient nav bar
rem
rem Mask for the tab
rem
rem (I think the fill color should not be relevant here, since were' only going to use the
rem alpha channel in subsequent operations. I make it blue so I can easily see it in testing.)
rem
convert^
-size 900x100^
xc:none^
-draw "fill blue stroke-width 0 path 'M 0,100 0,75 600,75 C 620,75 630,100 650,100 Z'"^
mask.png
rem Gradient for background
rem
convert^
-size 900x100^
gradient:#FFF-#FDD^
backgradient.png
rem Gradient for tab itself
rem
convert^
-size 700x25^
gradient:#F88-#F00^
tabgradient.png
rem Create cutout in background
rem
convert^
backgradient.png^
mask.png^
-alpha on^
-compose dst_out^
-composite^
cutout.png
rem Create header from files (this works great!)
rem
convert^
-gravity southwest^
cutout.png^
tabgradient.png^
-compose dst_over^
-composite^
goodheader.png
rem Do it all in one step. (This gives weird aliasing on right edge of tab!)
rem
convert^
-size 900x100^
gradient:#FFF-#FDD^
^
xc:none^
-draw "fill blue stroke-width 0 path 'M 0,100 0,75 600,75 C 620,75 630,100 650,100 Z'"^
-alpha on^
-compose dst_out^
-composite^
^
-size 700x25^
gradient:#F88-#F00^
-gravity southwest^
-compose dst_over^
-composite^
^
badheader.png