What is the easiest way to fill a opaque color area of an image that has a transparent background with a tile:Image.png and retain the transparent background.
I have no problem using convert fill to change the area to any color.
Also I can convert tile:Image.png compose and composite but that fills in the transparent background.
I have also tried doing with a mask without success.
Thank you
Wayne
fill with tile:Image.png - retain Transparent Background
-
- Posts: 4
- Joined: 2013-11-01T15:27:11-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: fill with tile:Image.png - retain Transparent Background
One way is to tile out a new image of the size of the area you want to replace, then composite the tiled image over that region (assuming you are talking about a rectangular area.
If might be helpful to see the image you want to start with in order to understand your problem better.
Also please identify your IM version and platform.
If might be helpful to see the image you want to start with in order to understand your problem better.
Also please identify your IM version and platform.
-
- Posts: 4
- Joined: 2013-11-01T15:27:11-07:00
- Authentication code: 6789
Re: fill with tile:Image.png - retain Transparent Background
I am using Version: ImageMagick 6.8.4-8 2013-04-09 Q16
My base image has a transparent background
I would like to replace the black with this swatch image below and retain the transparent background and tile the image to fit if needed
I am not able to create the mask needed in IM so the one you see below I created manually
I am able to execute the following command to create my final image below
convert green_swatch_200X200.png base_black_mask2.png -alpha off -compose copy_opacity -composite final_image.png
My base image has a transparent background
I would like to replace the black with this swatch image below and retain the transparent background and tile the image to fit if needed
I am not able to create the mask needed in IM so the one you see below I created manually
I am able to execute the following command to create my final image below
convert green_swatch_200X200.png base_black_mask2.png -alpha off -compose copy_opacity -composite final_image.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: fill with tile:Image.png - retain Transparent Background
try this (it extracts the alpha channel from the transparent base image)
convert green_swatch_200X200.png \( base_image.png -alpha extract \) -compose copy_opacity -composite result.png
convert green_swatch_200X200.png \( base_image.png -alpha extract \) -compose copy_opacity -composite result.png
Last edited by fmw42 on 2013-11-02T15:09:11-07:00, edited 1 time in total.
-
- Posts: 4
- Joined: 2013-11-01T15:27:11-07:00
- Authentication code: 6789
Re: fill with tile:Image.png - retain Transparent Background
Fred
It worked perfect
Thank you very much for the assist
Wayne
It worked perfect
Thank you very much for the assist
Wayne
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: fill with tile:Image.png - retain Transparent Background
If you have a base tile, you do not need to create the tiled image separately. You can combine it all in one command.
convert \( -size 200x200 tile:tree.gif \) \( base_image.png -alpha extract \) -compose copy_opacity -composite show:
convert \( -size 200x200 tile:tree.gif \) \( base_image.png -alpha extract \) -compose copy_opacity -composite show:
-
- Posts: 4
- Joined: 2013-11-01T15:27:11-07:00
- Authentication code: 6789
Re: fill with tile:Image.png - retain Transparent Background
Fred
You are really making my day
Wayne
You are really making my day
Wayne