ImageMagick command without intermediary file fails
Posted: 2015-05-25T11:35:14-07:00
I'm working on the example from ImageMagick called " Gel" Effects http://www.imagemagick.org/Usage/advanced/#gel_effects on the ImageMagick Example pages.
Instead of executing the ImageMagick script in many steps with intermediary images, I want to do it in ONE step with no intermediary files.
My code looks like this (95% same as the example):
These steps are copies of the steps in the example.
The problem is the last clone step:
This step causes the otherwise very nice image to become dark. I.e. no dropshadow is added. Up until that step, the one command works very nicely.
Furthermore. IF I save the image before the last step, like this:
and then perform the last clone on the tempbutton, like this:
then it works.
How can I avoid to save the image as that last step, and make this one big command?
Instead of executing the ImageMagick script in many steps with intermediary images, I want to do it in ONE step with no intermediary files.
My code looks like this (95% same as the example):
Code: Select all
convert.exe -size 150x64 xc:none -fill green
-draw "roundrectangle 10,10 140,54 8,8"
( +clone -alpha extract -blur 0x12 -shade 110x0
-normalize -sigmoidal-contrast 16,60% -evaluate multiply .5
-roll +4+8 +clone -compose Screen -composite ) -compose In -composite
( +clone -alpha extract -blur 0x2 -shade 0x90 -normalize -blur 0x2
+level 60,100% -alpha On ) -compose Multiply -composite
-font Verdana-Bold -pointsize 20 -fill white -stroke black -gravity Center
-annotate 0 "Download" -trim -repage 0x0+7+7
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
ButtonTest.png
The problem is the last clone step:
Code: Select all
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
Furthermore. IF I save the image before the last step, like this:
Code: Select all
convert.exe -size 150x64 xc:none -fill green
-draw "roundrectangle 10,10 140,54 8,8"
( +clone -alpha extract -blur 0x12 -shade 110x0
-normalize -sigmoidal-contrast 16,60% -evaluate multiply .5
-roll +4+8 +clone -compose Screen -composite ) -compose In -composite
( +clone -alpha extract -blur 0x2 -shade 0x90 -normalize -blur 0x2
+level 60,100% -alpha On ) -compose Multiply -composite
-font Verdana-Bold -pointsize 20 -fill white -stroke black -gravity Center
-annotate 0 "Download" -trim -repage 0x0+7+7
tempbutton.png
Code: Select all
convert.exe tempbutton.png
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
downloadbutton.png
How can I avoid to save the image as that last step, and make this one big command?