Cutting part from image with a mask
Posted: 2007-09-15T08:44:39-07:00
Hello,
I've been trying to get this to work all afternoon, I thought it would be simple but I can't get it to work
I have a .png mask, the black part of the mask indicates the area I want from a transparent .gif
First I make a tile of images and save it in a .gif with transparency:
![Image](http://img409.imageshack.us/img409/7159/49762260lx4.gif)
Then I have this mask:
![Image](http://img409.imageshack.us/img409/7947/49119183vx4.png)
The black area needs to be filled with the heart tiles, while the rest needs to remain transparent.
But this is what happens:
![Image](http://img514.imageshack.us/img514/4827/testuy2.gif)
So it's almost good, but the black color needs to be transparent. I know I can remove it with -transparent but if the tile.gif happens to have black in it it would remove too much. Can someone help me extract a part from a transparent gif and save it in a transparent png?
I've been trying to get this to work all afternoon, I thought it would be simple but I can't get it to work
![Sad :(](./images/smilies/icon_sad.gif)
I have a .png mask, the black part of the mask indicates the area I want from a transparent .gif
First I make a tile of images and save it in a .gif with transparency:
Code: Select all
convert -background None -size 373x280 tile:heart.png tile.gif
![Image](http://img409.imageshack.us/img409/7159/49762260lx4.gif)
Then I have this mask:
![Image](http://img409.imageshack.us/img409/7947/49119183vx4.png)
The black area needs to be filled with the heart tiles, while the rest needs to remain transparent.
But this is what happens:
Code: Select all
convert tile.gif mask.png -compose CopyOpacity -composite -matte output.gif
![Image](http://img514.imageshack.us/img514/4827/testuy2.gif)
So it's almost good, but the black color needs to be transparent. I know I can remove it with -transparent but if the tile.gif happens to have black in it it would remove too much. Can someone help me extract a part from a transparent gif and save it in a transparent png?