Colour overlay
Posted: 2007-12-06T07:07:04-07:00
Hi I am trying to make a system where by users can select a background colour and a foreground colour and a image. The system will then take the image that you have selected and use the foreground colour to colour it and the background colour behind it. I can do this but I want to keep the anti alias in order to make the images look smooth here is what I have so far
/usr/local/bin/convert -size 60x60 plasma:fractal -virtual-pixel edge -blur 0x5
-shade 140x45 -normalize
-size 1x100 xc:black -size 9x100 gradient:
+append '. $image_location_file;
The image_location_file is the place of the file. I don't quite know what this line does!?.
/usr/local/bin/convert -size 10x100 gradient:"'.$background_colour.'"-"'.$shape_colour.'" '.$gradient;
This line creates a gradient in a new file gradient
/usr/local/bin/convert '.$image_location_file.' '.$gradient.' -fx \'v.p{0,u*v.h}\' '.$image_location_file2;
This then applies the gradient
$cmd = '/usr/local/bin/convert '.$image_location_file2.' -matte -fill none -draw \'matte 0,0 floodfill\' '.$image_location_file2;
This removes the bg
$cmd = 'convert -size 60x60 xc:"'.$background_colour.'" -draw "image over 0,0 0,0
This puts the file on the background.
I thought this would work but I've been going round and round on this trying different methods.
If anyone has any ideas.
Thanks for any help.
/usr/local/bin/convert -size 60x60 plasma:fractal -virtual-pixel edge -blur 0x5
-shade 140x45 -normalize
-size 1x100 xc:black -size 9x100 gradient:
+append '. $image_location_file;
The image_location_file is the place of the file. I don't quite know what this line does!?.
/usr/local/bin/convert -size 10x100 gradient:"'.$background_colour.'"-"'.$shape_colour.'" '.$gradient;
This line creates a gradient in a new file gradient
/usr/local/bin/convert '.$image_location_file.' '.$gradient.' -fx \'v.p{0,u*v.h}\' '.$image_location_file2;
This then applies the gradient
$cmd = '/usr/local/bin/convert '.$image_location_file2.' -matte -fill none -draw \'matte 0,0 floodfill\' '.$image_location_file2;
This removes the bg
$cmd = 'convert -size 60x60 xc:"'.$background_colour.'" -draw "image over 0,0 0,0
This puts the file on the background.
I thought this would work but I've been going round and round on this trying different methods.
If anyone has any ideas.
Thanks for any help.